News for hackers. Stuff that matters.
Re:Lisp in Small Pieces of Clojure, part 3 by bjoli on Friday April 27, 2018 @11:12AM (#16941340)
I also never really liked the loop macro. I vastly prefer the racket-style for loops over the loop macro. There are some odd corners where the loop macro is cleaner (destructuring bind),but that is achievable in racket as well.

I still haven't actually had an occurrence when for/fold hasn't been enough for my special case needs.

Re:Lisp in Small Pieces of Clojure, part 3 by zeveb on Friday April 27, 2018 @02:35PM (#16943113)
Fortunately, if you want that sort of thing in Lisp there's always the iterate library: https://common-lisp.net/project/iterate/

It looks pretty good to me, and I hear good things about it, although frankly I've always just used LOOP.

Re:Lisp in Small Pieces of Clojure, part 3 by bjoli on Friday April 27, 2018 @04:02PM (#16943839)
Still very much a language on its own. Rackets loops look very much like a regular lisp construct.
Re:Lisp in Small Pieces of Clojure, part 3 by kbp on Friday April 27, 2018 @08:55PM (#16945553)
It sounds like you're the kind of person who'd prefer DOTIMES[0], DOLIST[1], and so on. Lisp has a lot of different ways to handle iteration, it's the curse of flexibility when people have such varying tastes. Another great option that often gets overlooked is the Series package[2], which lets you write in a functional style and then mostly optimises that away.

0: http://www.lispworks.com/documentation/HyperSpec/Body/m_doti...

1: http://www.lispworks.com/documentation/HyperSpec/Body/m_doli...

2: http://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node348.html#S...

Re:Lisp in Small Pieces of Clojure, part 3 by bjoli on Saturday April 28, 2018 @11:33AM (#16948117)
DOTIMES is not my cup of tea. I don't like to have to use mutation to get things done. I prefer to have an explicit but more verbose style (named let) or to use a for loop.

A matter of preference of course. The benefits of for loops or named lets is that they are functional and thus continuation safe. I did a bunch of continuation-based nondeterminism things last year, and knowing things weren't mutating was nice.

Re:Lisp in Small Pieces of Clojure, part 3 by lispm on Friday April 27, 2018 @01:06PM (#16942380)
If you need it, there is also an implementation of CL:LOOP for Racket.
Re:Lisp in Small Pieces of Clojure, part 3 by bjoli on Friday April 27, 2018 @04:26PM (#16944002)
Which is rather slow and doesn't add much. Other than awe that someone actually managed to do it :)
Re:Lisp in Small Pieces of Clojure, part 3 by lispm on Friday April 27, 2018 @04:31PM (#16944039)
Maybe it's not so slow with a better compiler, like the one from Chez Scheme - or is the implementation the problem?
Re:Lisp in Small Pieces of Clojure, part 3 by bjoli on Saturday April 28, 2018 @11:36AM (#16948135)
Most scheme implementations are better at optimizing non-mutating code since it can draw conclusions about types and such easier. Chez probably does a better job than racket because Chez is pretty spectacular :)