Arc Forumnew | comments | leaders | submitlogin
5 points by icemaze 4086 days ago | link | parent

Shameless plug: I discussed something similar here http://arclanguage.org/item?id=350


3 points by drcode 4086 days ago | link

I like yours, too...

Yours is far less invasive into the language. The trade-off is it doesn't give you cheap local variable creation, which was my primary motivation.

-----

1 point by icemaze 4085 days ago | link

True. What about ehird's variation (from the same thread)? It's a little more complex but should accomplish what you're looking for, since all the work is done at read time. Didn't try it tho, so give it a spin and let us know ^_^

-----

2 points by drcode 4085 days ago | link

Well, pretty much any solution involving a macro isn't going to do what I want. By necessity, calling a macro requires parentheses and a token. My solution just changes two parentheses to curly braces and requires no extra tokens. It will always be more lightweight than any macro solution. That's the main goal of my feature.

-----

3 points by tokipin 4086 days ago | link

note aand works similarly, with the exception that it shorts on nil:

http://arcfn.com/doc/anaphoric.html#aand

-----

1 point by icemaze 4085 days ago | link

Wow, that's true! I don't use aand much so I didn't notice. Shorting on nil can definitely be a problem because sometimes you want to do something different; it's not very readable since "aand" suggests a boolean result; finally, my macro could be modified in different ways that diverge from the usual aand semantics (like having a special form to break from the pipeline).

Thanks for the comment.

-----

1 point by almkglor 4086 days ago | link

Certainly interesting.

-----