Live data from Hacker News

Wherein Javascript borrows a language feature from Arc

twoguysarguing.wordpress.com

21–22 of 22 posts

Re: Wherein Javascript borrows a language feature from Arc

#21
post #6

Clojure has #(+ % 10) for Arc's [+ _ 10]. Does anyone know if Arc inspired Clojure, or whether there's prior art for this syntax?

I think Clojure copied Arc on this.

Actually it was inspired by Mathematica:

http://reference.wolfram.com/mathematica/ref/Slot.html

Re: Wherein Javascript borrows a language feature from Arc

#22
post #12

Earlier quoted context omitted.

It also conflicts with gettext libraries. The name '_' should be considered reserved for that purpose.

Not to be a jerk, but why? What if gettext isn't important to your current application? (I don't know a lot about gettext; I went and read the blurb.)

In pretty much any language which has a gettext implementation, "_" is the name used for the function/method/whatever which marks a string for translation. This is just as true in JavaScript (at least two JS gettext implementations that I know of use "_"). It's one of the few truly cross-language naming conventions I know of.

But libraries which expect to be able to use "_" for something other than gettext break this convention, and not only run the risk of screwing interoperability but also cause confusion for the (large number of) developers who are accustomed to "_" having a particular meaning.

Post reply on HN