Re: [racket-users] Strange behaviour of the eq? operator in racket repl

2015-05-19 Thread Michael Tiedtke
Il giorno 18/mag/2015, alle ore 21.34, Jens Axel Søgaard ha scritto: 2015-05-18 21:25 GMT+02:00 Michael Tiedtke michael.tied...@o2online.de: Il giorno 18/mag/2015, alle ore 20.50, Jos Koot ha scritto: I think Rackets's reference and guide are *very clear* about eq?, eqv? and equal?.

Re: [racket-users] Strange behaviour of the eq? operator in racket repl

2015-05-18 Thread Michael Tiedtke
Structure and Interpretation of Computer Programs (sicp2) about sameness: https://mitpress.mit.edu/sicp/full-text/book/book-Z-H-16.html#footnote_Temp_230 We can consider two symbols to be ``the same'' if they consist of the same characters in the same order. Such a definition skirts a deep

Re: [racket-users] Strange behaviour of the eq? operator in racket repl

2015-05-18 Thread Matthias Felleisen
SICP isn' the bible, especially not on programming language knowledge. I'd recommend checking out relevant literature instead. On May 18, 2015, at 8:24 AM, Michael Tiedtke michael.tied...@o2online.de wrote: Structure and Interpretation of Computer Programs (sicp2) about sameness:

Re: [racket-users] Strange behaviour of the eq? operator in racket repl

2015-05-18 Thread Atticus
George Neuner gneun...@comcast.net writes: Hi, On 5/17/2015 5:32 PM, Atticus wrote: --- $ racket Welcome to Racket v6.1.1. (eq? 'l 'l) #f (eq? 'l 'l) #t $ racket --no-jit Welcome to Racket v6.1.1. (eq? 'l 'l) #f (eq? 'l 'l) #t (eq? 'l 'l) #f

Re: [racket-users] Strange behaviour of the eq? operator in racket repl

2015-05-18 Thread Michael Tiedtke
Il giorno 18/mag/2015, alle ore 18.06, Atticus ha scritto: I guess it's a matter of definition. I must admit that i didn't reflect on equality that much. My (very limited) knowledge about that stuff comes mostly from the The Little Schemer which imho explains it really well with the 'eqan?'

Re: [racket-users] Strange behaviour of the eq? operator in racket repl

2015-05-18 Thread Atticus
I guess it's a matter of definition. I must admit that i didn't reflect on equality that much. My (very limited) knowledge about that stuff comes mostly from the The Little Schemer which imho explains it really well with the 'eqan?' and 'eqlist?' procedure. The reason why i checked (eq? 'symbol1

RE: [racket-users] Strange behaviour of the eq? operator in racket repl

2015-05-18 Thread Jos Koot
even an unsolvable thing. Jos -Original Message- From: racket-users@googlegroups.com [mailto:racket-users@googlegroups.com] On Behalf Of Michael Tiedtke Sent: lunes, 18 de mayo de 2015 19:00 To: racket-users@googlegroups.com Subject: Re: [racket-users] Strange behaviour of the eq

Re: [racket-users] Strange behaviour of the eq? operator in racket repl

2015-05-18 Thread Greg Hendershott
In my early time learning Racket, I wish someone had given me the following advice: For now? Just use `equal?`. `equal?` will usually do the right thing, including for numbers, strings, symbols, immutable lists, and so on. A type-specific function like `=` or `string-=?` might be a bit faster.

Re: [racket-users] Strange behaviour of the eq? operator in racket repl

2015-05-18 Thread Michael Tiedtke
Il giorno 18/mag/2015, alle ore 20.50, Jos Koot ha scritto: I think Rackets's reference and guide are *very clear* about eq?, eqv? and equal?. Yes, right. It was the Racket Reference to tell me exactly that eqv? is an eq? that works for numbers and characters, too. I really had to look this

Re: [racket-users] Strange behaviour of the eq? operator in racket repl

2015-05-18 Thread Jens Axel Søgaard
2015-05-18 21:25 GMT+02:00 Michael Tiedtke michael.tied...@o2online.de: Il giorno 18/mag/2015, alle ore 20.50, Jos Koot ha scritto: I think Rackets's reference and guide are *very clear* about eq?, eqv? and equal?. Yes, right. It was the Racket Reference to tell me exactly that eqv? is

RE: [racket-users] Strange behaviour of the eq? operator in racket repl

2015-05-18 Thread Jos Koot
of equality. Jos -Original Message- From: racket-users@googlegroups.com [mailto:racket-users@googlegroups.com] On Behalf Of Greg Hendershott Sent: lunes, 18 de mayo de 2015 20:56 To: racket-users@googlegroups.com Subject: Re: [racket-users] Strange behaviour of the eq? operator in racket repl In my

Re: [racket-users] Strange behaviour of the eq? operator in racket repl

2015-05-18 Thread Alexander D. Knauth
On May 18, 2015, at 1:19 AM, Michael Tiedtke michael.tied...@o2online.de wrote: I'm new to Racket but even R5RS is rather clear about this issue: (citation from doc/r5rs/r5rs-std/r5rs-Z-H-9.html) (eq? 2 2) === unspecified In Racket, (eq? 2 2) is specified as true. It says here:

RE: [racket-users] Strange behaviour of the eq? operator in racket repl

2015-05-18 Thread Jos Koot
[mailto:michael.tied...@o2online.de] Sent: lunes, 18 de mayo de 2015 21:26 To: Jos Koot; racket-users@googlegroups.com Subject: Re: [racket-users] Strange behaviour of the eq? operator in racket repl snip Maybe, I never thought about that in mathematical terms if not with the concept of identity. How could

Re: [racket-users] Strange behaviour of the eq? operator in racket repl

2015-05-18 Thread Hendrik Boom
On Mon, May 18, 2015 at 08:50:50PM +0200, Jos Koot wrote: At the mathematical level equality is a difficult and in many cases even an unsolvable thing. Indeed. It is suspected by some that difficulties with equality lie at the root of problems with set theory. There are two concepts of

Re: [racket-users] Strange behaviour of the eq? operator in racket repl

2015-05-17 Thread Alexis King
Yes, Scheme (and therefore Racket) has eq?, eqv?, and equal?. I understand the desire for eq? and equal?, but I’ve always been skeptical of the necessity of eqv?. Either way, Scheme left this behavior unspecified, but I believe Racket specifies it (though I could be wrong). Racket has two

Re: [racket-users] Strange behaviour of the eq? operator in racket repl

2015-05-17 Thread Michael Tiedtke
I'm new to Racket but even R5RS is rather clear about this issue: (citation from doc/r5rs/r5rs-std/r5rs-Z-H-9.html) (eq? 2 2) === unspecified Rationale: It will usually be possible to implement eq? much more efficiently than eqv?, for example, as a simple pointer comparison instead of