Re: [racket-users] Generic collections in Racket

2015-05-26 Thread Alexis King
> Alexis, think of a lazy sequence as something that the rest of the program > will explore. In addition to a GUI-based exploration, I would love to see a > programmatic one. Imagine > > (explore-lazy lazy-sequence:exp strictness-pattern:exp) > > where (the value of) strictness-pattern is a f

Re: [racket-users] Generic collections in Racket

2015-05-25 Thread Alexis King
> With fallback methods, you can get the best of both worlds. > > You can have a base set of methods that implementers of the interface > need to write, and from which everything else can be derived. The > derived methods can also be present in the interface, which allows > implementers to overrid

Re: [racket-users] Generic collections in Racket

2015-05-25 Thread Vincent St-Amour
At Sun, 24 May 2015 17:26:12 -0700, Alexis King wrote: > > > 1. What if you do care about the order? IOW should there also be > > generic "cons" and "snoc"? > > Having a generic cons is a good idea, and I will consider a good way to > incorporate it. However, there are lots of tradeoffs in variou

Re: [racket-users] Generic collections in Racket

2015-05-25 Thread Matthias Felleisen
Alexis, think of a lazy sequence as something that the rest of the program will explore. In addition to a GUI-based exploration, I would love to see a programmatic one. Imagine (explore-lazy lazy-sequence:exp strictness-pattern:exp) where (the value of) strictness-pattern is a function that

Re: [racket-users] Generic collections in Racket

2015-05-25 Thread Alexis King
> I recently hacked together a little GUI thingy for showing > enumerations that just let them scroll by inside what looks like the > normal enumeration print out and it works by sampling and caching the > first 200 elements of the enumeration, but being careful about errors > and to staying the us

Re: [racket-users] Generic collections in Racket

2015-05-25 Thread Robby Findler
On Mon, May 25, 2015 at 12:48 AM, Alexis King wrote: >> Depending on other design decisions, it make make sense to consider >> this an IDE issue. That is, maybe the best thing is to have some kind >> of interactive value in the REPL that lets the user have control over >> the effects. (And this do

Re: [racket-users] Generic collections in Racket

2015-05-24 Thread Alexis King
> Depending on other design decisions, it make make sense to consider > this an IDE issue. That is, maybe the best thing is to have some kind > of interactive value in the REPL that lets the user have control over > the effects. (And this doesn't just have to be via some kind of > simplistic mouse

Re: [racket-users] Generic collections in Racket

2015-05-24 Thread Robby Findler
On Sun, May 24, 2015 at 7:43 PM, Alexis King wrote: > As for printing these sequences... yes, printing as # sucks. > Currently you can always force a sequence with sequence->list, but that's > annoying. Clojure takes the approach of making printing lazy sequences force > them. This is okay, but

Re: [racket-users] Generic collections in Racket

2015-05-24 Thread Alexis King
Thanks for the feedback! To start out with, let me address your initial three points. With regards to the error messages and tooling, I agree completely, and I actually think this is one of the areas where Racket can blow Clojure out of the water. Contracts alone are pretty expressive, and I'd a

Re: [racket-users] Generic collections in Racket

2015-05-24 Thread Alexis King
Thanks for the detailed response! > One part I'm not sure about is `conj`. I understand sometimes > "whichever end is optimal" matters more than the order. But: Indeed, you are correct. Order does matter, and currently the only way to do that sort of thing is with `append`. > 1. What if you do

Re: [racket-users] Generic collections in Racket

2015-05-24 Thread Daniel Prager
Hi Alexis Nice! I've been playing with Clojure a bit recently and I 1. several aspects (like the generic operations, concise destructuring, etc.), 2. am frustrated with others (e.g. error messages and tooling), 3. are intrigued by some of the other design choices (e.g. pervasive use

Re: [racket-users] Generic collections in Racket

2015-05-24 Thread Greg Hendershott
> Also, in my (admittedly limited) time so far with Clojure, I've > sometimes been confused when eager collections automagically change > into lazy sequences. If I add side effects (like debugging printfs) to > code I don't realize is lazy, I utter many WTFs. I'm not sure to what > extent that can

Re: [racket-users] Generic collections in Racket

2015-05-24 Thread Greg Hendershott
This is really exciting and you've obviously put a lot of time and thought into it! One part I'm not sure about is `conj`. I understand sometimes "whichever end is optimal" matters more than the order. But: 1. What if you do care about the order? IOW should there also be generic "cons" and "snoc

[racket-users] Generic collections in Racket

2015-05-23 Thread Alexis King
It's no secret that I've been angling to try and implement a generic collections library in Racket for a while now. After a few iterations, I think I've found a model I'm satisfied with. It's become big enough to now consider useful, so I'd like to get some feedback. If you're interested: $ rac