On Sat, Apr 25, 2009 at 4:50 PM, Abdulaziz Ghuloum <[email protected]> wrote: > There might be some subtle differences in other aspects > of running the program, like the behavior of call/cc or even read.
Yes, I am aware of those differences. Also, in the REPL you can import modules at any moment, in scripts the import forms are the beginning. > [PS. your definition of assert-distinct should use bound-identifier=? > instead of free-identifier=?, unless I misunderstood what it's used > for. It is for checking duplicates in binding forms, like lambda, let > and letrec, right?] > I will free admit that I do not understand the details of free-identifier=? vs bound-identifier=? and that the R6RS document looks Greek to me when it tries to explain the differences. What I have grossly understood is that I should use bound-identifier=? when I want to check for names that to be bound (like names in a let form) and free-identifier=? if I want to compare a name with an unbound name, like a literal identifier. But this is foggy to me, for instance I do not understand the difference between free-identifier=? and a simple function like (define (identifier=? n1 n2) (eq? (syntax->datum n1) (syntax->datum n2))) The use case I had in mind was not a let form, but a multi-define form like this one: (def-syntax (multi-define (name1 name2 ...) (value1 value2 ...)) #'(begin (define name1 value1) (define name2 value2) ...)) This is basically the same as a let form, so I should have used bound-identifier=? according to the R6RS, but I preferred to use the form I was insecure about, in order to get corrected and to learn something ;-)
