Re: [racket-users] Case and eof

2016-04-06 Thread Jay McCarthy
You would want (== eof), because 'eof' is just an identifier, so you're binding x to eof. Jay On Wed, Apr 6, 2016 at 12:05 PM, rom cgb wrote: > On Monday, April 4, 2016 at 10:44:46 PM UTC+2, Alex Knauth wrote: >> I'm convinced that implicit quotes are the root of almost

Re: [racket-users] Case and eof

2016-04-06 Thread rom cgb
On Monday, April 4, 2016 at 10:44:46 PM UTC+2, Alex Knauth wrote: > I'm convinced that implicit quotes are the root of almost all evil in lisp > programming languages. That's a big reason why I like the teaching languages > better in terms of things making sense. > > It's also why I normally

Re: [racket-users] Case and eof

2016-04-04 Thread Jon Zeppieri
On Mon, Apr 4, 2016 at 3:40 PM, Jay McCarthy wrote: > case is just for integers and symbols. > I'm not sure if you meant this as a claim about how you think `case` should be used, but it certainly does work for more than just integers and symbols. It will work for any

Re: [racket-users] Case and eof

2016-04-04 Thread Alex Knauth
> On Apr 4, 2016, at 3:40 PM, Jay McCarthy wrote: > (member eof '(eof)) is #f > > Because '(eof) is the same as (list 'eof) NOT (list eof) > > Jay I'm convinced that implicit quotes are the root of almost all evil in lisp programming languages. That's a big reason

Re: [racket-users] Case and eof

2016-04-04 Thread Jens Axel Søgaard
2016-04-04 21:34 GMT+02:00 rom cgb : > Hi, > > Trying to use eof in a case expression but it doesn't work. > > For example > > (define (test x) > (case x > [(eof) eof] > [else "else"])) > > > (test eof) will then evaluate to "else" despite

Re: [racket-users] Case and eof

2016-04-04 Thread Jay McCarthy
case is just for integers and symbols. (case x [(eof) eof] [else "else"]) is equivalent to (cond [(member x '(eof)) eof] [else "else"]) and (member eof '(eof)) is #f Because '(eof) is the same as (list 'eof) NOT (list eof) Jay On Mon, Apr 4, 2016 at 3:34 PM, rom cgb