Re: [racket-dev] Need a clarification on the implementation of stream-map

2012-07-10 Thread Daniel King
ream based on racket/sequence which I wrote. You'll > have to ask him whether he added support for multiple-value sequences > and how to get them. > > Jay > > On Tue, Jul 10, 2012 at 4:15 PM, Daniel King wrote: >> On Tue, Jul 10, 2012 at 9:06 PM, Jay McCarthy wrote: >>

[racket-dev] Need a clarification on the implementation of stream-map

2012-07-08 Thread Daniel King
Question 0: In collects/racket/stream.rkt, `stream-map' is defined as: (define (stream-map f s) (unless (procedure? f) (raise-argument-error 'stream-map "procedure?" f)) (unless (stream? s) (raise-argument-error 'stream-map "stream?" s)) (let loop ([s s]) (cond [(stream

[racket-dev] Set Equality with Cyclic Structure is not as Expected

2012-05-07 Thread Daniel King
Hi, The following code snippet is a bit confusing to me. Sets with cyclic structure are not equal? even though they meet my intuitive definition of equal. I'm curious exactly where my intuition goes wrong. I imagine the reason why Racket can conclude that the lists are equal is because the orderi

Re: [racket-dev] An Improvement to for/set

2012-02-20 Thread Daniel King
On Sun, Feb 19, 2012 at 22:20, Matthias Felleisen wrote: > for/set sounds and looks more uniform with the rest of the loops, no? I disagree, I think for/union is a natural analogue for for/product and for/sum. Both for/union and for/set should be in the set library. > union you can throw in as a

[racket-dev] An Improvement to for/set

2012-02-17 Thread Daniel King
I've noticed myself desiring a for/set that would allow me to optionally add zero, one, or more elements to the accumulated set during each iteration. Is this something that other people would be interested in having in the set library? If so, I can send a pull request to the github repo. My imple

Re: [racket-dev] Add `set-get-one' and `set-get-one/rest' to set.rkt

2012-01-27 Thread Daniel King
I haven't received any replies regarding this pull request. On Thu, Dec 15, 2011 at 14:57, Daniel King wrote: > The procedure `set-get-one/rest' returns a random element from the set and a > new > set with that element removed. It is used for iterating over a set It >

[racket-dev] Add `set-get-one' and `set-get-one/rest' to set.rkt

2011-12-15 Thread Daniel King
The procedure `set-get-one/rest' returns a random element from the set and a new set with that element removed. It is used for iterating over a set It is not guaranteed to return the same element if it is called twice on the original set. The procedure `set-get-one' only returns a random element f

Re: [racket-dev] feature request: gcd, lcm for rationals

2011-12-09 Thread Daniel King
On Fri, Dec 9, 2011 at 15:27, Carl Eastlund wrote: > What does "divides" even mean in Q?  I think we need David to explain > what his extension of GCD and LCM means here, in that "divisors" and > "multiples" are fairly trivial things in Q. I don't suppose to understand all the math on this page,

Re: [racket-dev] Why is there no `stream' macro which functions analogously to the `list' macro?

2011-12-08 Thread Daniel King
On Thu, Dec 8, 2011 at 09:51, Daniel King wrote: > Ah, I just realized there's a tests folder at racket/collects/tests. > I'll update the pull request. Done. -- Dan King College of Computer and Information Science Northeastern University ___

Re: [racket-dev] Why is there no `stream' macro which functions analogously to the `list' macro?

2011-12-08 Thread Daniel King
On Thu, Dec 8, 2011 at 09:40, Matthew Flatt wrote: > (For further pull requests, please include test cases --- which in this > case would have caught the use of `stream-empty' instead of > `empty-stream'.) Ah, I just realized there's a tests folder at racket/collects/tests. I'll update the pull r

[racket-dev] Why is there no `stream' macro which functions analogously to the `list' macro?

2011-12-05 Thread Daniel King
I initiated a pull request [1] to add a `stream' macro which produces streams in much the same way the `list' macro does; however, after speaking with Vincent and Stevie, I'm not sure this is the right approach. I understand that `list' can be used to construct things which can be used as streams,