This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: unknown allocation kind '#<syntax (quote static) in #8>'


On 10/05/2011 04:17 PM, Jamison Hope wrote:
In a macro expanding to a define-simple-class, if a field init: form
references a macro argument, then that field's allocation: expression
will result in an error like the one in the subject line.
...
If that "init: docstr" is changed [to a literal], then the error goes away:

I'm not sure why making the init form be literal makes a difference for the allocation.
I suspect it's because this makes the entire "tail"
(allocation: 'static init: "literal")
literal (at least in terms of macro expansion - there are no macro parameters in it).
This when the macro template is expanded we get a single SyntaxForm that
wraps the entire tail (which gets handled by an earlier getDatum call) rather
than multiple SyntaxForm for smaller parts of the macro expansion.


I'm not really sure why that makes a difference, but the attached patch
fixes it:

I think the patch is good. However, I think we might as well use the Translator#stripSyntax method, as attached. -- --Per Bothner per@bothner.com http://per.bothner.com/

Attachment: obj.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]