Hacker News new | past | comments | ask | show | jobs | submit login

> Neither is it done in Common Lisp.

LOOP is something that imho very controversial. I don't think it's fair to say that its use is idiomatic.




> LOOP is something that imho very controversial.

No, not really: it's as controversial as Common Lisp's Lisp-n nature (which is to say, both of which are controversial amongst Scheme programmers writing Common Lisp). It's a perfectly useful macro. ITERATE is a bit more traditionally Lispy, and is an easy library away if one wants it.

> I don't think it's fair to say that its use is idiomatic.

Not using it is typically less clear. It's part of the standard; it's more elegant than using other parts of the standard; it's idiomatic.


Eh, no, it was controversial when it was being developed in the early '80s, a lot of respectable Lispers didn't like it, thought it was too complicated and easy to get wrong. But Common Lisp also has simpler constructs like dolist that aren't, to my knowledge, "controversial", except of course as you note this paradigm isn't a Scheme sort of thing.


It's idiomatic to use a sublanguage. Think FORMAT. CLOS. Control flows using the condition system. LOOP is just another style to extend Lisp. There are older libraries which use similar style.

Simple example from Winston&Horn's book LISP for a database query language:

   (db-select screwdrivers with color eql red)


Note that Common Lisp does not require tail-call elimination, so recursion is not really a standard operation. There's no one who thinks LOOP is a crawling horror than me, but it or something like it is your only option.


`loop` is used everywhere in common lisp, including a lot of the code I write. It's definitely idiomatic.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: