Hacker Newsnew | comments | ask | jobs | submitlogin
pg 1589 days ago | link | parent

They're different from while and and: whilet is a combination of while and let that binds its first argument to the result of the test. aand binds the result of successive tests to "it" for use in succeeding tests.

))))))) isn't overkill to Lisp hackers. Lisp hackers read code by indentation and rarely notice the parens, especially terminating ones. There have been dialects (Franz Lisp) that used ] to close off all open parens, but it would be a waste to use up a good char like ] to fix a non-problem.



ricky_clarkson 1588 days ago | link

I expect that ] to close all open parens would lead to code that is even tighter jammed to the left margin. I like that I feel comfortable writing nested code in Lisp, and if I was always looking for somewhere to put a ] I'd be tempted not to write nested code, and hence start leaking private identifiers.

-----

minimalcriminal 1589 days ago | link

Ah that makes sense! Hope you don't mind but is there any ideas for a loop/iterate/series type macro in the works?

-----

pg 1588 days ago | link

Arc has a bunch of iteration constructs. It's iteration-friendly. Most previous Lisps have been ambivalent about iteration, because their designers didn't like side effects.

The usual Lisp do macro, for example. What a wretched bit of language design. Even now, whenever I encounter one, I have to stop and translate it in my head. Plus it can be very verbose. The reason do is so bad is that whoever designed it wanted to make it as functional (in the no-side effect sense) as possible. But sometimes side effects are just the right model.

BTW, there is a do in Arc. It's the new name for what used to be called progn. (It's surprising how much better that little change makes code look.)

-----

sketerpot 1588 days ago | link

Does Arc have an API for iterating across general types of data structures? The classic example is lists and arrays; in Common Lisp, supporting both can be a hassle and the language itself seems ad hoc when the issue arises. MAP supports both, but MAPCAR doesn't; the LOOP macro has seperate "IN" and "ACROSS" syntax, and no (standard) way to extend this to user-defined data types.

-----

pg 1588 days ago | link

This sort of thing works much more cleanly in Arc.

-----




Lists | RSS | Bookmarklet | Guidelines | FAQ | News News | Feature Requests | Y Combinator | Apply | Library

Search: