Since keyword definitions expand into multiple defines, and inserting
the contract and external id definitions at the wrong point will cause
those to break, we handle define manually.
Hat-tip to Vincent for the idea.
Doing this means that we can't put a single splicing-syntax-parameterize
around the entire body, since it'll expand defines before we reach them,
so instead we add them around the expanded code.
to gc:cons and gc:closure instead of passing locs
This enables the important change, namely that get-root-set
no longer returns roots corresponding to the arguments
of the allocation function that we're in the middle of.
This means that a common error students have (forgetting
to chase the 'hd' and 'tl' pointers in their GC) is
harder to make now, since get-root-set never contains
those locations as roots. (In the past you would have had
to write some pretty non-obvious mutator program to get
that behavior.)
* See comment about implementation issues.
* Removed the `list?' requirement on `takef' etc -- so it matches the
non-*f versions. (IMO, it'd be better to drop it from all of them.)
This also changes the output of `dropf' to `any/c'.
* Swapped the argument order so the predicate is last -- this makes it
uniform with the non-f* versions. (IMO, it'b be better to use the
popular order in all of them instead.)
* Includes tests, and also improved version of previous tests.
* Includes docs, and also fixes to previous docs (eg, drop* doesn't
return a fresh list).
As a side-effect of this fix, we don't need the thunking behavior for
external identifiers anymore. Even better!
Also include some other cleanups suggested by Ryan and moves from
quasisyntax/loc -> syntax/loc where we don't use the quasiquoting.
generate so much code
(Mostly to avoid pain with the macro stepper, but also
reducing the amount of code macros generates is good
for performance reasons)