[Prototype-core] Re: Function.EMPTY and Function.K
Function.IDENTITY and Function.EMPTY are never called directly, though. They're canonical functions. Agreed. Hence, Function.reference instead of Function.empty. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[Prototype-core] Re: Function.EMPTY and Function.K
Are you sure not Function.eMpTy ? :P --- Warm Regards, Ryan Gahl On Fri, Oct 16, 2009 at 6:15 AM, Joran Greef jorangr...@gmail.com wrote: Function.IDENTITY and Function.EMPTY are never called directly, though. They're canonical functions. Agreed. Hence, Function.reference instead of Function.empty. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[Prototype-core] Re: Function.EMPTY and Function.K
On Oct 16, 9:14 am, Ryan Gahl ryan.g...@gmail.com wrote: Are you sure not Function.eMpTy ? Would the order of capitalization be based on phase of the moon? [...] -- kangax --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[Prototype-core] Re: Function.EMPTY and Function.K
Hi, Andrew. As previously mentioned, K is ambiguous, as it can mean both: function K(arg) { return arg; } or: function K(arg) { return function() { return arg; }; } depending on your reference (Tcl for the former, combinatory logic for the latter). My vote therefore goes for using Function.IDENTITY. I'm also strongly in favor of using uppercase for constant-like objects. Given the language, this is of course purely conventional (much like the underscore prefix for private methods). It's a very useful nonetheless. Best, Tobie --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[Prototype-core] Re: Function.EMPTY and Function.K
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 -~--~~~~--~~--~--~---
[Prototype-core] Re: Function.EMPTY and Function.K
Extends your Prototype, the Force does, mnn... --- Warm Regards, Ryan Gahl On Fri, Oct 16, 2009 at 4:48 PM, joneff jon...@gmail.com wrote: (off topic, or would it be May the Force extends your.prototype?) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---