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 Oct 6, 2011, at 5:34 AM, Per Bothner wrote:

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.

That seems as reasonable an explanation as anything I could think of.


I think the patch is good.  However, I think we might as well use the
Translator#stripSyntax method, as attached.

Makes sense. There are a few other places that could probably use similar
refactoring. A grep for "while.*instanceof.*syntaxform" returns a bunch of
hits, though in some of those cases a reference to the syntax object is
also retained, as in Lambda.java's


	while (body instanceof SyntaxForm)
	  {
	    syntax0 = (SyntaxForm) body;
	    body = syntax0.getDatum();
	  }

Hmm.. if only Java had multiple value returns..


-- Jamison Hope The PTR Group www.theptrgroup.com




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