Sent from my iPhone >> On Dec 2, 2016, at 1:26 PM, Matthew Butterick <[email protected]> wrote: >> >> On Dec 1, 2016, 5:33 PM -0800, Matthew Flatt <[email protected]>, wrote: >> >> Assuming that "without lexical context" means "no scopes"[*], I don't >> think there's a simpler way right now than walking through the syntax >> object and making sure that each scope set is empty. And maybe there's >> no easier way to check for an empty scope set than using >> `bound-identifier=?` on an identifier with a scope set to test and an >> identifier that definitely has an empty scope set. > > Specifically, what I was trying to do was write a contract for the return > value of `read-syntax` that's narrower than just `syntax?` (which is > insufficient, since `read-syntax` has to return a stx object without > bindings).
Does that mean it will yell at you when used with langs like afl, curly-fn, and sugar/debug? Or are you using this because you'll end up calling strip-context anyway? > One can make such a stx object with `(datum->syntax #f ···)` or > `(strip-context ···)`. So the mystery predicate here would return #t for stx > objects made either of those ways. > > PS is the name of `strip-context` obsolete? Should it be `strip-scope-sets`? No, the lexical information is still more than just the scope-sets, I believe it also includes other information about bindings. So strip-context is still relevant. (See also functions like identifier-prune-lexical-context, which if I understand correctly leaves scopes alone and prunes other information) -- You received this message because you are subscribed to the Google Groups "Racket Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-dev/69918AC3-3276-4A2A-85BC-314B5FCCF8C9%40knauth.org. For more options, visit https://groups.google.com/d/optout.
