---------- Forwarded message ---------- From: *Lyle Kopnicky* <lylew...@gmail.com> Date: Wednesday, September 30, 2015 Subject: [racket-users] Defining a symbol breaks symbols? To: Jason Hemann <jhem...@umail.iu.edu>
Ha, thanks, Jens and Jason, for the explanation. That makes sense. I'm used to static languages lately and it's been a long time since I've programmed in a Lisp. See question inline. On Sep 30, 2015, at 10:43 AM, Jason Hemann <jhem...@umail.iu.edu <javascript:_e(%7B%7D,'cvml','jhem...@umail.iu.edu');>> wrote: I don't think that's a bug. Instad, it's fun with reader macros. 'x expands into (quote x) What you've got there is something like (define (quote foo) 5). And is a perfectly good looking function. And it's useable too. > '`bar 5 This sort of thing can be fun and useful > (define c3 (lambda (quote) (lambda (z) '''z))) > ((c3 add1) 0) 3 That bothers me a bit. It looks unhygienic, as the quote function is being captured. I guess reader macros can't have hygiene? JBH On Wed, Sep 30, 2015 at 1:35 PM, Lyle Kopnicky <lylew...@gmail.com <javascript:_e(%7B%7D,'cvml','lylew...@gmail.com');>> wrote: > Hi folks, > > It seems that if I (incorrectly) quote a symbol in a 'define' form, it > breaks all symbols from that point on. I would expect instead it would give > me an error saying that I passed the wrong sort of thing to 'define', and > not break future use of symbols. Is this a bug? > > Welcome to DrRacket, version 6.2.1 [3m]. > Language: racket; memory limit: 128 MB. > > 'foo > 'foo > > 'bar > 'bar > > (define 'foo 5) > > 'foo > . . foo: undefined; > cannot reference an identifier before its definition > > 'bar > . . bar: undefined; > cannot reference an identifier before its definition > > > > Thanks, > Lyle > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscr...@googlegroups.com > <javascript:_e(%7B%7D,'cvml','racket-users%2bunsubscr...@googlegroups.com');> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.