3 ms·
Common Lisp's iter or loop macros are special syntax for, among other things, building lists. I think maybe you should have said instead that it's nice when a l
by omaranto 7y ago
Common Lisp's iter or loop macros are special syntax for, among other things, building lists. I think maybe you should have said instead that it's nice when a language let's you add such special syntax in libraries. :)
- bjoli 7y agoThat is not quite what I want to get across. I think python's list comprehensions are great, but I think they are a shit replacement for a proper looping facility that does everything python's list comprehensions do and more. Racket's for loops are also macros that expand to tail recursive procedures within a letrec, but they are "standard syntax" (in the sense that they are included in the base library) just as loop is.
- omaranto 7y agoWell, Python does have a looping facility that can do everything it's comprehensions can do and more. It's just more special syntax and looks somewhat different from the comprehensions (though they do share keywords where appropriate). I mean, I too prefer loop or iter but Python isn't looping-poor.
- bjoli 7y agoIt can't return a list :) It is as if someone said "wow! Returning something from a loop is useful", but instead of going all the way they added special syntax for it.