Re: [racket-users] Are fixnums guaranteed to be `eq?` whenever they are `=`/`equal?` ?

2016-03-14 Thread Matthew Flatt
At Mon, 14 Mar 2016 19:59:51 -0400, Tony Garnock-Jones wrote: > On 03/14/2016 07:53 PM, Matthew Flatt wrote: > > [fixnum eqness is guaranteed by the docs. > > [...] And keywords [are also guaranteed]. > > [...] [And] Booleans, void, and characters with a scalar value under 256. > > > > Opaque

Re: [racket-users] Are fixnums guaranteed to be `eq?` whenever they are `=`/`equal?` ?

2016-03-14 Thread Matthew Flatt
At Mon, 14 Mar 2016 19:43:51 -0400, Tony Garnock-Jones wrote: > Can I rely on the truth of the following: > > (implies (and (fixnum? x) (fixnum? y) (= x y)) >(eq? x y)) > > ? Yes, that's guaranteed by the docs. > I know I can rely on something similar for symbols. And keywords.

[racket-users] Are fixnums guaranteed to be `eq?` whenever they are `=`/`equal?` ?

2016-03-14 Thread Tony Garnock-Jones
Hi all, Can I rely on the truth of the following: (implies (and (fixnum? x) (fixnum? y) (= x y)) (eq? x y)) ? I know I can rely on something similar for symbols. What other sorts of values can I rely on eq? being an appropriate equivalence predicate for? Tony -- You received

[racket-users] custom input ports

2016-03-14 Thread Jon Zeppieri
Almost every time I've created a custom input port, I've run up against the rule: "The read-in procedure must not block indefinitely." And each time, I've either: - ignored it (with the suspicion that I've just written code that can block the whole process, though I've never actually verified

RE: [racket-users] Re: Sequential vs. Parallel 13-Queens program

2016-03-14 Thread Jos Koot
I have looked up a N-queens program I made a long time ago. It finds all solutions. My timings are faster I think. I need 2 seconds (in DrRacket) for N=12. 14200 solutions of which 1787 are not symmetrically equivalent. If you want I send you the code privately. 83 lines. Finding the solutions

Re: Re: [racket-users] Pattern Matching in Macros | Meaning of dot

2016-03-14 Thread Jens Axel Søgaard
Yes, lambda expression have an implicit begin in the body. > (begin . (1 2 3)) 3 > (begin (1 2 3)) application: not a procedure; expected a procedure that can be applied to arguments given: 1 arguments...: Here (begin . (1 2 3)) is the same as (begin 1 2 3). The

Re: Re: [racket-users] Pattern Matching in Macros | Meaning of dot

2016-03-14 Thread Pedro Caldeira
Does that mean that lambda expressions have an implicit (begin …) block in them? (begin ((displayln 1) (displayln 2) (displayln 3))) leads to an error (begin . ((displayln 1) (displayln 2) (displayln 3))) displays to 1 2 3 Thank you for the detailed explanation I think I get it now. > On 13

Re: [racket-users] Sequential vs. Parallel 13-Queens program

2016-03-14 Thread Jerry Jackson
This is a bit off-topic (though it is about N-queens) but I've long wanted to ask people if an idea I had once is a well-known one. It once occurred to me that solutions to N-rooks can be viewed as linear transformations that correspond to permutations of a vector. So, then I wondered to what