[Prototype-core] Re: Function.EMPTY and Function.K
On Thursday 15 October 2009 01:08:53 Andrew Dupont wrote: Weighing in again, decades after starting the thread. First, I'm fine with calling it Function.IDENTITY instead of Function.K. On Sep 25, 2009, at 1:26 AM, T.J. Crowder wrote: Make sense. Shouldn't that be Function.empty and Function.k, though, to follow our naming rules? And perhaps Function.k should have a more meaningful name. I'm very much in favor of all-caps, or at least initial caps, to indicate that these are constants. Aren't most functions 'constants'? Eg, Array.empty isn't supposed to be reassigned but we don't write Array.EMPTY We don't do this consistently in the framework so far, but I'd like it to match stuff like Event.KEY_ESC. I think the capitalization will also help distinguish it from String#empty and Array#empty, as was mentioned elsewhere. (Aside: I'm also in favor of renaming those methods to `isEmpty` for 2.0.) What do people think about the capitalization? Cheers, Andrew -- Jim my wiki ajaxification thing: http://wikizzle.org my blog: http://jimhigson.blogspot.com/ --~--~-~--~~~---~--~~ 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
Hey Andrew, Aren't all functions constants, in that sense? Function.EMPTY isn't more or less constant than Element.extend. -- T.J. ;-) On Oct 15, 1:08 am, Andrew Dupont goo...@andrewdupont.net wrote: Weighing in again, decades after starting the thread. First, I'm fine with calling it Function.IDENTITY instead of Function.K. On Sep 25, 2009, at 1:26 AM, T.J. Crowder wrote: Make sense. Shouldn't that be Function.empty and Function.k, though, to follow our naming rules? And perhaps Function.k should have a more meaningful name. I'm very much in favor of all-caps, or at least initial caps, to indicate that these are constants. We don't do this consistently in the framework so far, but I'd like it to match stuff like Event.KEY_ESC. I think the capitalization will also help distinguish it from String#empty and Array#empty, as was mentioned elsewhere. (Aside: I'm also in favor of renaming those methods to `isEmpty` for 2.0.) What do people think about the capitalization? Cheers, Andrew --~--~-~--~~~---~--~~ 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
Guys... (tapping shoulder)... um this is some pretty inconsequential stuff that's being debated, wouldn't you say? Just do Function.empty = Function.EMPTY = function() {}; (or just pick one) Sorry, it really just doesn't matter vs. file size, modularity, performance, features, (17 other facets I can't think of right now...). --- Warm Regards, Ryan Gahl On Thu, Oct 15, 2009 at 4:22 AM, T.J. Crowder t...@crowdersoftware.comwrote: Hey Andrew, Aren't all functions constants, in that sense? Function.EMPTY isn't more or less constant than Element.extend. -- T.J. ;-) On Oct 15, 1:08 am, Andrew Dupont goo...@andrewdupont.net wrote: Weighing in again, decades after starting the thread. First, I'm fine with calling it Function.IDENTITY instead of Function.K. On Sep 25, 2009, at 1:26 AM, T.J. Crowder wrote: Make sense. Shouldn't that be Function.empty and Function.k, though, to follow our naming rules? And perhaps Function.k should have a more meaningful name. I'm very much in favor of all-caps, or at least initial caps, to indicate that these are constants. We don't do this consistently in the framework so far, but I'd like it to match stuff like Event.KEY_ESC. I think the capitalization will also help distinguish it from String#empty and Array#empty, as was mentioned elsewhere. (Aside: I'm also in favor of renaming those methods to `isEmpty` for 2.0.) What do people think about the capitalization? Cheers, Andrew --~--~-~--~~~---~--~~ 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 15, 2009, at 4:22 AM, T.J. Crowder wrote: Hey Andrew, Aren't all functions constants, in that sense? Function.EMPTY isn't more or less constant than Element.extend. Function.IDENTITY and Function.EMPTY are never called directly, though. They're canonical functions. Meh, if I'm the only one who thinks of them that way, I'll shut up. But I want to hear from more people. Cheers, Andrew -- T.J. ;-) On Oct 15, 1:08 am, Andrew Dupont goo...@andrewdupont.net wrote: Weighing in again, decades after starting the thread. First, I'm fine with calling it Function.IDENTITY instead of Function.K. On Sep 25, 2009, at 1:26 AM, T.J. Crowder wrote: Make sense. Shouldn't that be Function.empty and Function.k, though, to follow our naming rules? And perhaps Function.k should have a more meaningful name. I'm very much in favor of all-caps, or at least initial caps, to indicate that these are constants. We don't do this consistently in the framework so far, but I'd like it to match stuff like Event.KEY_ESC. I think the capitalization will also help distinguish it from String#empty and Array#empty, as was mentioned elsewhere. (Aside: I'm also in favor of renaming those methods to `isEmpty` for 2.0.) What do people think about the capitalization? Cheers, Andrew --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---