A quick follow-up.

Timothy Sample <samp...@ngyro.com> writes:

> Lastly, you should read section 3.1 of “Binding as Sets of Scopes”:
>
>     
> https://www-old.cs.utah.edu/plt/scope-sets/general-macros.html#%28part._.Identifier_.Comparisons_with_.Scope_.Sets%29
>
> It shows that ‘bound-identifier=?’ gives false negatives in both
> sets-of-scopes and marks-and-substitutions hygiene systems.  (I didn’t
>
> test that example or anything, but I thought it fit the theme of
> identifier predicate arcana pretty well.)

Actually, read section 3.2.  It covers your example exactly.  Discussing
the example

> (free-identifier=? (let ([x 1]) #'x)
>                    #'x)

it says,

> Note: Racket’s macro system matches Dybvig et al. (1993), where both
> free-identifier=? and bound-identifier=? produce #f for the above
> arguments, and bound-identifier=? always implies
> free-identifier=?. The current psyntax implementation, as used by Chez
> Scheme and other implementations and as consistent with Adams (2015),
> produces #f and #t for free-identifier=? and bound-identifier=?,
> respectively; as the example illustrates, bound-identifier=? does not
> imply free-identifier=?. The set-of-scopes system produces #t and #t
> for free-identifier=? and bound-identifier=?, respectively, and
> bound-identifier=? always implies free-identifier=?.

You can actually control what ‘free-identifier=?’ returns for the above
example using “scope pruning” when quoting syntax.  Those Racketeers
really have their act together....  :)


-- Tim

Reply via email to