Re: RTL Question

2012-06-20 Thread Andy Wingo
On Tue 19 Jun 2012 05:52, Noah Lavine noah.b.lav...@gmail.com writes: Time for my next RTL question - how do I use the toplevel-ref instruction? It looks like I need to make a variable object in the instruction stream, or at a known offset from it. I think I should use either

Bug in documentation for eq? ?

2012-06-20 Thread David Kastrup
I read Numbers and characters are not equal to any other object, but the problem is they're not necessarily `eq?' to themselves either. This is even so when the number comes directly from a variable, (let ((n (+ 2 3))) (eq? n n)) = *unspecified* I

Re: Bug in documentation for eq? ?

2012-06-20 Thread Andy Wingo
On Wed 20 Jun 2012 12:40, David Kastrup d...@gnu.org writes: Numbers and characters are not equal to any other object, but the problem is they're not necessarily `eq?' to themselves either. This is even so when the number comes directly from a variable, (let ((n (+ 2

Re: Bug in documentation for eq? ?

2012-06-20 Thread David Kastrup
Andy Wingo wi...@pobox.com writes: On Wed 20 Jun 2012 12:40, David Kastrup d...@gnu.org writes: Numbers and characters are not equal to any other object, but the problem is they're not necessarily `eq?' to themselves either. This is even so when the number comes directly from

Re: Bug in documentation for eq? ?

2012-06-20 Thread David Kastrup
David Kastrup d...@gnu.org writes: I think it is completely absurd. It would mean, for example, that (memq x (list x)) is generally unspecified. It would mean that things like (eq? (car x) (car x)) are generally unspecified even when x is a pair. So that we can have (eq? x x) but not (eq?

Re: Bug in documentation for eq? ?

2012-06-20 Thread Andy Wingo
Hi, [bunch of examples] Which of the above would you consider unspecified? As the Scheme standard clearly states, all the ones comparing numbers with eq?. You find some of them surprising; that is your problem ;) The answer is to not compare numbers with eq?. Regards, Andy --

Re: bug#10410: guile: uri module confused by domain names starting with numbers, ipv6 addresses

2012-06-20 Thread Ludovic Courtès
Hi Daniel, Daniel Hartwig mand...@gmail.com skribis: I have noticed that the (web uri) module does not handle domain names that start with numbers: scheme@(guile-user) (string-uri http://123.com;) $1 = #f This one was fixed around commit 1868309a9e34a04a5b3020e147d0ce029038b290. Thanks,

Re: Bug in documentation for eq? ?

2012-06-20 Thread Noah Lavine
Hello, I think you're talking past each other a little bit. Andy is saying that the Scheme standard doesn't specify eq? on numbers. David is saying that an object should always be eq? to itself, no matter what object. I believe David's claim is that Guile should guarantee that a variable is eq?

Re: Bug in documentation for eq? ?

2012-06-20 Thread Andy Wingo
On Wed 20 Jun 2012 15:41, Noah Lavine noah.b.lav...@gmail.com writes: I believe David's claim is that Guile should guarantee that a variable is eq? to itself, even though the standard doesn't. We could guarantee this, but it would prevent a number of interesting and permissible optimizations,

Re: Bug in documentation for eq? ?

2012-06-20 Thread David Kastrup
Andy Wingo wi...@pobox.com writes: Hi, [bunch of examples] Which of the above would you consider unspecified? As the Scheme standard clearly states, all the ones comparing numbers with eq?. You find some of them surprising; that is your problem ;) The answer is to not compare numbers

Re: Bug in documentation for eq? ?

2012-06-20 Thread David Kastrup
Andy Wingo wi...@pobox.com writes: On Wed 20 Jun 2012 15:41, Noah Lavine noah.b.lav...@gmail.com writes: I believe David's claim is that Guile should guarantee that a variable is eq? to itself, even though the standard doesn't. We could guarantee this, but it would prevent a number of

Re: Bug in documentation for eq? ?

2012-06-20 Thread Andy Wingo
On Wed 20 Jun 2012 16:31, David Kastrup d...@gnu.org writes: Andy Wingo wi...@pobox.com writes: interesting and permissible optimizations Name one. FWIW, eta-conversion (for primitives). Copy propagation for the purposes of inlining (a la Waddell). Storing numbers in unboxed form, and

Re: Bug in documentation for eq? ?

2012-06-20 Thread Pierpaolo Bernardi
On Wed, Jun 20, 2012 at 4:27 PM, David Kastrup d...@gnu.org wrote: Andy Wingo wi...@pobox.com writes: If the Scheme standard states that (and (pair? x) (not (eq? (car x) (car x can return #t in a conforming implementation, that means that the standard failed to do its job for weeding

Re: Bug in documentation for eq? ?

2012-06-20 Thread David Kastrup
Andy Wingo wi...@pobox.com writes: On Wed 20 Jun 2012 16:31, David Kastrup d...@gnu.org writes: Andy Wingo wi...@pobox.com writes: interesting and permissible optimizations Name one. FWIW, eta-conversion (for primitives). Copy propagation for the purposes of inlining (a la Waddell).

Re: Bug in documentation for eq? ?

2012-06-20 Thread David Kastrup
Andy Wingo wi...@pobox.com writes: On Wed 20 Jun 2012 16:27, David Kastrup d...@gnu.org writes: I am not comparing numbers when writing (eq? x x). I am checking the identity of an object. Whether that object is a number or not, and if so, what value it has, is irrelevant. x is not an

Re: Bug in documentation for eq? ?

2012-06-20 Thread David Kastrup
Pierpaolo Bernardi olopie...@gmail.com writes: On Wed, Jun 20, 2012 at 4:27 PM, David Kastrup d...@gnu.org wrote: Andy Wingo wi...@pobox.com writes: If the Scheme standard states that (and (pair? x) (not (eq? (car x) (car x can return #t in a conforming implementation, that means that

Re: Bug in documentation for eq? ?

2012-06-20 Thread Andy Wingo
On Wed 20 Jun 2012 17:16, David Kastrup d...@gnu.org writes: Whatever. It is quite clear that you can't be bothered with caring about sane semantics when the standard gives you a free pass. Forget I asked. I don't see the point in further serving as a target for pseudointellectual mockery.