Well, I prefer the left-to-right dataflow, but that might just be force of habit, and this version is a lot cleaner and simpler to implement. Not sure about '//' for the macro name (looks like division), but this looks the best way to do this.
Ah, make that deja vu and egocentrism-based dyslexia. ><;
Implementing the pipeline left-to-right order is just a matter of switching "before" and "after," I think.
Hmm, macros and special forms seem a bit confusing that way around... but maybe they'd just look like list comprehensions or something. What about having both operators? What might their precedence be like?
As far as naming goes, I was trying to pick something unused that would appear to be part of the parenthesis in some way. :-p
(<< a b c : x y z) => (a b c (x y z))
(>> a b c : x y z) => (x y z (a b c))
then? Still looks slightly like less-than/greater-than, but this gives a visual cue for data direction, and avoids needing to care about relative precedence.
Fyi, your other comment on this thread (http://arclanguage.org/item?id=14886) is dead. It was obviously a valid post, but it apparently tripped the detector.
For one, you have an extra set of parentheses around the body of the function. Parenthetical expressions like
(expr1 expr2 expr3 ...)
by default will evaluate expr1 and try to call it with the arguments expr2, expr3, .... E.g.,
arc> (+ 1 2 3)
6
This sort of rule applies recursively, so
((if (> 1 2) - +) 1 2 3)
first evaluates
(if (> 1 2) - +)
which returns the function + (since (> 1 2) is false), meaning the original evaluates to
(+ 1 2 3)
There are a few places where parenthetical expressions don't evaluate this way, but they're usually pretty obvious -- like the argument list in a def. For more details, the tutorial is a decent place to start learning about Arc & Lisp programming: http://ycombinator.com/arc/tut.txt.
To fix your code immediately, you'd just need to get rid of the extra parens. Expressions in the body of a function evaluate one after the other, returning the value of the last expression, so given
(def f (x)
(+ x 1)
(+ x 2))
a call to f will calculate (+ x 1) and (+ x 2), returning the latter.
But you should (generally) only use = for global variables. For local ones, you'll want with or let.
arc> (let x 1 (+ x 1))
2
arc> (with (x 1 y 2) (+ x y))
3