MACROEXPAND-ALL and COMPILER-MACROLET need home package

5 messages Options
Embed this post
Permalink
Erik Huelsmann

MACROEXPAND-ALL and COMPILER-MACROLET need home package

Reply Threaded More More options
Print post
Permalink
One comment regarding our 0.15 release which I'm about to cut: We need
to make MACROEXPAND-ALL and COMPILER-MACROLET publicly available in a
package. Currently they are internal in the SYSTEM package, which
probably isn't good enough.

Who could take a stab at this change before Sunday (the date at which
I plan to cut the final release)?


Bye,

Erik.

------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
armedbear-j-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/armedbear-j-devel
Ville Voutilainen

Re: MACROEXPAND-ALL and COMPILER-MACROLET need home package

Reply Threaded More More options
Print post
Permalink
On Thu, Jun 4, 2009 at 6:02 PM, Erik Huelsmann <[hidden email]> wrote:
> One comment regarding our 0.15 release which I'm about to cut: We need
> to make MACROEXPAND-ALL and COMPILER-MACROLET publicly available in a
> package. Currently they are internal in the SYSTEM package, which
> probably isn't good enough.

Here's a stab at macroexpand-all. I'm a complete novice/layman at lisp
packages, so
I'm not at all sure what I'm doing here. :) Comments welcome, I'll cook together
a patch for COMPILER-LET shortly.

[package-macroexpand-all.diff]

Index: src/org/armedbear/lisp/precompiler.lisp
===================================================================
--- src/org/armedbear/lisp/precompiler.lisp (revision 11990)
+++ src/org/armedbear/lisp/precompiler.lisp (working copy)
@@ -1000,11 +1000,13 @@
 
 (export '(precompile-form))
 
-(in-package #:system)
-
+(in-package #:ext)
 (defun macroexpand-all (form &optional env)
   (precompiler:precompile-form form nil env))
 
+(in-package #:system)
+
+
 (defmacro compiler-let (bindings &body forms &environment env)
   (let ((bindings (mapcar #'(lambda (binding)
                               (if (atom binding) (list binding) binding))
Index: src/org/armedbear/lisp/Symbol.java
===================================================================
--- src/org/armedbear/lisp/Symbol.java (revision 11990)
+++ src/org/armedbear/lisp/Symbol.java (working copy)
@@ -2857,6 +2857,8 @@
     PACKAGE_EXT.addExternalSymbol("INTERRUPT-LISP");
   public static final Symbol GETENV =
     PACKAGE_EXT.addExternalSymbol("GETENV");
+  public static final Symbol MACROEXPAND_ALL =
+    PACKAGE_EXT.addExternalSymbol("MACROEXPAND-ALL");
 
   // MOP.
   public static final Symbol STANDARD_READER_METHOD =


------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
armedbear-j-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/armedbear-j-devel
Alessio Stalla

Re: MACROEXPAND-ALL and COMPILER-MACROLET need home package

Reply Threaded More More options
Print post
Permalink
On Fri, Jun 5, 2009 at 5:05 PM, Ville Voutilainen
<[hidden email]> wrote:

> On Thu, Jun 4, 2009 at 6:02 PM, Erik Huelsmann <[hidden email]> wrote:
>> One comment regarding our 0.15 release which I'm about to cut: We need
>> to make MACROEXPAND-ALL and COMPILER-MACROLET publicly available in a
>> package. Currently they are internal in the SYSTEM package, which
>> probably isn't good enough.
>
> Here's a stab at macroexpand-all. I'm a complete novice/layman at lisp
> packages, so
> I'm not at all sure what I'm doing here. :) Comments welcome, I'll cook together
> a patch for COMPILER-LET shortly.

Imho it depends on who's the "owner" of those symbols. If they're in
:system because other code in system uses them, perhaps it would be
better to keep them defined in system and in addition import and
export them from :ext. Otherwise, if they are in :system "by
accident", they can safely be moved in ext altogether. As a matter of
strict personal preference, I tend to avoid having multiple in-package
forms in the same file, but that's just me.

Just my €.02

Bye,
Alessio

------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
armedbear-j-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/armedbear-j-devel
Ville Voutilainen

Re: MACROEXPAND-ALL and COMPILER-MACROLET need home package

Reply Threaded More More options
Print post
Permalink
In reply to this post by Erik Huelsmann
Here's another stab.

[package-macroexpand-all-and-compiler-let.diff]

Index: src/org/armedbear/lisp/precompiler.lisp
===================================================================
--- src/org/armedbear/lisp/precompiler.lisp (revision 11990)
+++ src/org/armedbear/lisp/precompiler.lisp (working copy)
@@ -1000,11 +1000,12 @@
 
 (export '(precompile-form))
 
-(in-package #:system)
-
+(in-package #:ext)
 (defun macroexpand-all (form &optional env)
   (precompiler:precompile-form form nil env))
 
+(in-package #:lisp)
+
 (defmacro compiler-let (bindings &body forms &environment env)
   (let ((bindings (mapcar #'(lambda (binding)
                               (if (atom binding) (list binding) binding))
@@ -1014,6 +1015,8 @@
                        (eval (cadr binding))) bindings)
       (macroexpand-all `(progn ,@forms) env))))
 
+(in-package #:system)
+
 (defun set-function-definition (name new old)
   (let ((*warn-on-redefinition* nil))
     (sys::%set-lambda-name new name)
Index: src/org/armedbear/lisp/Lisp.java
===================================================================
--- src/org/armedbear/lisp/Lisp.java (revision 11990)
+++ src/org/armedbear/lisp/Lisp.java (working copy)
@@ -76,6 +76,8 @@
     Packages.createPackage("PROFILER");
   public static final Package PACKAGE_JAVA =
     Packages.createPackage("JAVA");
+  public static final Package PACKAGE_LISP =
+    Packages.createPackage("LISP");
 
   // ### nil
   public static final LispObject NIL = Nil.NIL;
@@ -110,6 +112,9 @@
         PACKAGE_PROF.usePackage(PACKAGE_EXT);
         PACKAGE_JAVA.usePackage(PACKAGE_CL);
         PACKAGE_JAVA.usePackage(PACKAGE_EXT);
+        PACKAGE_LISP.usePackage(PACKAGE_CL);
+        PACKAGE_LISP.usePackage(PACKAGE_EXT);
+        PACKAGE_LISP.usePackage(PACKAGE_SYS);
       }
     catch (Throwable t)
       {
Index: src/org/armedbear/lisp/Symbol.java
===================================================================
--- src/org/armedbear/lisp/Symbol.java (revision 11990)
+++ src/org/armedbear/lisp/Symbol.java (working copy)
@@ -2857,6 +2857,8 @@
     PACKAGE_EXT.addExternalSymbol("INTERRUPT-LISP");
   public static final Symbol GETENV =
     PACKAGE_EXT.addExternalSymbol("GETENV");
+  public static final Symbol MACROEXPAND_ALL =
+    PACKAGE_EXT.addExternalSymbol("MACROEXPAND-ALL");
 
   // MOP.
   public static final Symbol STANDARD_READER_METHOD =
@@ -2986,4 +2988,6 @@
   public static final Symbol _INSPECTOR_HOOK_ =
     PACKAGE_EXT.addExternalSymbol("*INSPECTOR-HOOK*");
 
+  public static final Symbol COMPILER_LET=
+    PACKAGE_LISP.addExternalSymbol("COMPILER-LET");
 }
Index: src/org/armedbear/lisp/autoloads.lisp
===================================================================
--- src/org/armedbear/lisp/autoloads.lisp (revision 11990)
+++ src/org/armedbear/lisp/autoloads.lisp (working copy)
@@ -305,8 +305,14 @@
 (autoload 'compile-file-if-needed "compile-file")
 (export 'describe-compiler-policy)
 (autoload 'describe-compiler-policy)
+(export 'macroexpand-all)
+(autoload 'macroexpand-all)
 
 ;; JVM compiler.
 (in-package "JVM")
 (export '(jvm-compile-package))
 (autoload '%with-compilation-unit "jvm")
+
+(in-package "LISP")
+(export 'compiler-let)
+(autoload 'compiler-let)


------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
armedbear-j-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/armedbear-j-devel
Erik Huelsmann

Re: MACROEXPAND-ALL and COMPILER-MACROLET need home package

Reply Threaded More More options
Print post
Permalink
On Fri, Jun 5, 2009 at 9:12 PM, Ville Voutilainen
<[hidden email]> wrote:
> Here's another stab.

These changes have now landed on the trunk as well as the release branch.

Bye,


Erik.

------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
armedbear-j-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/armedbear-j-devel