3 ms·
I hadn't followed up on it since the previous proposal but....thank goodness. The pound-sign lambda annoyed me since other lambda capable languages use it to d
by evilduck 16y ago
I hadn't followed up on it since the previous proposal but....thank goodness.
The pound-sign lambda annoyed me since other lambda capable languages use it to denote comments. It wasn't a dealbreaker, but it certainly was less than preferred.
- cabalamat 16y agoI agree. I know of no other language where a # is used to denote lambdas. I would prefer one of: 1. a keyword such as fn, fun, function, lambda. (Incidently, my language uses fn) 2. {...} are used to denote code blocks in many languages, including Java 3. -> or => are also used for functions in several languages (IIRC C# uses =>)
- Zak 16y ago# is used for lambda shorthand in Clojure. #(+ % %2) is shorthand for (fn [x y] (+ x y)).
- cabalamat 16y agoThat's a nice shorthand. AIUI, Arc uses [... _ ....] as a terse shorthand for closures, but can only deal with functions that take one argument that way -- though it would be simple to expand Arc so it could say [+ _ _2]. Now I've thought about it, I may add something similar as syntax in Unify: (tn + _ _2) (where tn stands for "terse function")