GSOC | Extending Common Lisp support

Per Bothner per@bothner.com
Sun Jul 1 20:47:00 GMT 2012


On 07/01/2012 09:56 AM, Charles Turner wrote:
> That's a good plan. I posted a change file for the types, which
> actually might have contained some small fixes, but I didn't notice
> them whilst reading through it.

Also - please submit each patch as a new thread with a separate Subject.
I'm getting a bit tired of everything langing i the same thread ...

>> Also, what's your preferred way to fix Lisp2's getNamespaceOf for
>> syntax declarations? You had suggested something like
>> getFlag(Declaration.PROCEDURE|Declaration.IS_SYNTAX) but the
>> former flag is not public. So I'm sitting on a change that looks like
>>
>> $ svn diff gnu/commonlisp/lang/Lisp2.java
>> Index: gnu/commonlisp/lang/Lisp2.java
>> ===================================================================
>> --- gnu/commonlisp/lang/Lisp2.java      (revision 7259)
>>
>> +++ gnu/commonlisp/lang/Lisp2.java      (working copy)
>> @@ -61,7 +61,9 @@
>>       // function and variable position.
>>       if (decl.isAlias())
>>         return FUNCTION_NAMESPACE+VALUE_NAMESPACE;
>> -    return decl.isProcedureDecl() ? FUNCTION_NAMESPACE : VALUE_NAMESPACE;
>> +    return (decl.isProcedureDecl() ||
>> +            decl.getFlag(Declaration.IS_SYNTAX)) ?
>> +      FUNCTION_NAMESPACE : VALUE_NAMESPACE;
>>     }
>>
>>     /** Get a symbol for a given (interned) Java string. */
>>
>> which works but is ugly. Methinks we need either an isSyntaxDecl() method,
>> or we need Declaration.PROCEDURE to be public, for better consistency.

I checked this it now.

> Yeah, I'm using the following to fix that
>
> Index: gnu/expr/Declaration.java
> ===================================================================
> --- gnu/expr/Declaration.java	(revision 7259)
> +++ gnu/expr/Declaration.java	(working copy)
> @@ -230,7 +230,7 @@
>     public final void setSyntax ()
>     {
>       setSimple(false);
> -    setFlag(IS_CONSTANT|IS_SYNTAX|EARLY_INIT);
> +    setFlag(IS_CONSTANT|IS_SYNTAX|EARLY_INIT|PROCEDURE);
>     }
>
>     /** Return the ScopeExp that contains (declares) this Declaration. */
> @@ -501,7 +501,7 @@
>
>     /** True if in the function namespace, for languages that distinguishes them.
>      * I.e. a function definition or macro definition. */
> -  static final int PROCEDURE = 0x80;
> +  public static final int PROCEDURE = 0x80;
>
>     public static final int IS_ALIAS = 0x100;

Do you still need to set PROCEDURE in setSyntax?
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/




More information about the Kawa mailing list