My $0.02: I find #:while and #:when to be too close, and #:until and #:unless even closer.
Robby On Fri, Sep 14, 2012 at 2:30 PM, Eli Barzilay <e...@barzilay.org> wrote: > 5 hours ago, Carl Eastlund wrote: >> >> Has this been brought up before? I can't recall. Does anyone else >> run into the same issue? > > (I think that I brought this up when the comprehensions were first > discussed, pointing at the similar tool I have in Swindle which makes > implementing them very easy.) > > > Four hours ago, Matthew Flatt wrote: >> >> Also, I think the names `#:while' and `#:until' are too close to >> `#:when' and `#:unless'. I suggest `#:break-when' and `#:break-unless'. >> Compare: >> >> > (for*/list ([j 2] [i 10] #:when (i . < . 5)) i) >> '(0 1 2 3 4 0 1 2 3 4) >> > (for*/list ([j 2] [i 10] #:break-unless (i . < . 5)) i) >> '(0 1 2 3 4) >> >> I imagine that `#:break-when' and `#:break-unless' are allowed among >> the clauses much like `#:when' and `#:unless', but also allowed at the >> end of the body. Is that what you had in mind? > > Sorry for the bike-shedding, but to me that `#:break-unless' is even > harder to read than `#:until'. Possible explanation: "break unless" > makes me parse two words and figure out how they combine, and "while" > is something that I know without doing so. > > Another point to consider in favor of `#:while' and `#:until' is that > they're extremely common names, so they're unlikely to be *that* > problematic. > > (I intentionally left the typo in the first sentence as a > demonstration of how it's confusing to read...) > > > A different point is that maybe there should also be a `while' and > `until' looping constructs in the language? (Whatever they're > called.) Every once in a while (ahem) I want that when I write: > > (let loop () > (when (more-work-to-do) > (work!))) > > And it looks like this: > > (for (#:while (more-work-to-do)) > (work!)) > > would not work in the same way that (for () (work!)) doesn't loop > forever(?). > > -- > ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: > http://barzilay.org/ Maze is Life! > > _________________________ > Racket Developers list: > http://lists.racket-lang.org/dev _________________________ Racket Developers list: http://lists.racket-lang.org/dev