Don't get me wrong, but we are not talking about splitting the core of the
atom in 16 different particles. Instead the topic of discussion is how to
name (and where to place) the empty and identity function.

Two things should be taken into account -- common sense and consistency.

Deriving from mathematics, how is this function called -- f(x) = x, for
every instance of x? Identity function. That's a the perfect name (as
mentioned above).

And since this is not a constant function, no need to be capitalized. And
since JS is generally camel case, first letter stays lowercase.

The place to put it? The Function object. Hence, Function#identity

Now apply the consistency and you get Function#empty

Simple as that.


Or use purely statistical approach:

If anyone bothered to sum up this elaborate discussion the result would be:

1) Prototype#emptyFunction and Prototype#K are considered / approved / you
name it for deprecation by the majority of people who post here

2) Function#empty (and caps) and Function#identity (and caps) are considered
/ approved / you name it for addition by the majority of the people who post
here.

Logical outcome -- if the core developers haven't decided yet whether or not
to use caps, make a poll (if you feel like to it), or use any random way to
determine the value of a boolean (0 for small caps, 1 for caps) -- get
wasted, ask a stranger, wait for 2012.

My apologies if I am rude in my words, but it's either commons sense, or
toss a coin (observe the moon phase etc).

*** A bit off topic ***

The real issue to me is consistency. While many of you noted that Prototype
was born of adapting ruby-like syntax for Java Script, I prefer it because
it's much closer to actual programming than some JS libraries and is not as
complicated as other libraries.

However, due to incompatibility of syntax between ruby and JS (string#empty?
per say) changes in the core (Language extension part) must made. The best
place to look for inspiration would be other ECMA standardized languages /
dialect, such as Action Script (the closes dialect to JavaScript there is)
or C# (not so close, but still in the vicinity of close syntax).

*** End of off topic ***

Again, two key components -- consistency and common sense.

May the Force.prototype extends you.

-- joneff

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to 
prototype-core-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to