[racket-users] cannot produce units from syntax transformers

2015-11-28 Thread Nota Poin
I'm not sure why, but this works: (unit (import foo^) (export bar^) (+ foo bar))) while this fails: (define-syntax-rule (asyn body ...) (unit (import foo^) (export bar^) body ...)) (asyn (+ foo bar)) with the error "unit: undefined export" for any imported variables.

Re: [racket-users] cannot produce units from syntax transformers

2015-11-28 Thread Matthew Flatt
Your example is similar to (define-syntax-rule (with-x body) (let ([x 5]) body)) (with-x x) ; => unbound identifier That is, `import` is a binding form, just like `let`. Bindings introduced by a hygienic macro do not capture identifiers at the macro-use site. If you want non-hygienic

[racket-users] Contracts vs Signatures for HtDP?

2015-11-28 Thread Paolo Giarrusso
While pointing students at teachpacks for HtDP/2e, one of our tutors correctly pointed out that they're not documented using HtDP signatures, but using standard Racket contracts. For instance, in big-bang's docs: > (to-draw render-expr) > render-expr: (-> WorldState scene?)

Re: [racket-users] change DrRacket syntax coloring per-source rather than per-lang?

2015-11-28 Thread Matthew Butterick
> But now that looked at the pollen docs, I see the issue. It looks like > you have to be able to run the config submodule of some program to be > able to figure out how to syntax color it I'm making progress with your suggested technique but hitting a dead end inside DrRacket. Here's what I've

Re: [racket-users] change DrRacket syntax coloring per-source rather than per-lang?

2015-11-28 Thread Matthew Butterick
> Anyway, In DrRacket, files are not always saved before they are run so > you cannot reliably get a path. In general, the source name of a > syntax object or the object-name of a port doesn't have to be anything > in particular and the source location of the file is generally only > available

Re: [racket-users] change DrRacket syntax coloring per-source rather than per-lang?

2015-11-28 Thread Robby Findler
I don't want to lay claim to suggesting this technique as I am not sure it is a good idea. I mean to be explaining that, not suggesting you use it in my earlier message. :) In particular, it means that if you put a syntax error (or malicious code) into the pollen config then you will crash

Re: [racket-users] cannot produce units from syntax transformers

2015-11-28 Thread Nota Poin
On Saturday, November 28, 2015 at 11:24:28 PM UTC, Matthew Flatt wrote: > That is, `import` is a binding form, just like `let`. Oh, that makes sense. So it gets swapped in the macro for a hygenic named variable, and the ones I pass by that name don't get swapped in the same fashion, thus aren't