[racket] getting some weird toplevel values from zo-parse

From: Danny Yoo (dyoo at cs.wpi.edu)
Date: Tue May 24 14:36:15 EDT 2011

>> which appear to index into offset 83 and 82 of the prefix.  However,
>> the prefix is only supposed to have space for 7 num-lifts, plus 68
>> toplevels, plus 1 more bucket to hold syntax.
> No, there's a bucket for each syntax object (plus the one bucket for
> having any syntax objects at all), which is another 8 buckets.

Ok, I'm definitely confused then.  Here's what's in zo-parse's documentation:


    """Represents a “prefix” that is pushed onto the stack to initiate
evaluation. The prefix is an array, where buckets holding the values
for toplevels are first, then a bucket for another array if stxs is
non-empty, then num-lifts extra buckets for lifted local

The documentation makes it sound like the number of buckets is:

    (+ number-of-toplevels
        (if (> number-of-syntaxes 0) 1 0)

But if I understand you correctly, you're saying that it really should be:

    (+ number-of-toplevels
        (if (> number-of-syntaxes 0) 1 0)

And that the layout should be toplevels, followed by syntax buckets,
followed by lift buckets.  Is that right?

Posted on the users mailing list.