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: macro problem




On 12/03/2014 12:17 PM, Seth Alves wrote:
I'm trying to run ssax with Kawa.  It's getting hung up during macro
expansion -- it will either hang or exit with an error:

self-referential (cyclic) syntax template

I've tried to boil it down to a small example, but this is the best
I've gotten.  This doesn't do anything useful, but other schemes
accept it. Should it load in Kawa or is there actually something
wrong with it?

I didn't try to really understand what was going on.  However,
my hunch was that the problem wasn't actually a cycle, but rather
sharing: The same list fragment showed up multiple times in the
(macro-generated) template.  Fixing that was fairly simple:
We just need to not only 'put' this current Pair into the 'seen'
table before recursing - but we also need to 'remove' it when done.

I checked this change in.

It should be possible to handle actual cycles in the template.
translating it to a template program that builds a cyclic result.
However, that seems more trouble than it's worth.
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/


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