why do not you like the anonymous function?

On 25 дек, 00:42, "T.J. Crowder" <t...@crowdersoftware.com> wrote:
> Hi,
>
> I'm sorry to say that I really can't tell what you're asking. I mean,
> singletons in JavaScript are dead easy because objects are just
> objects:
>
>     var Singleton = {
>         foo: function() {
>             // ...
>         },
>         bar: function() {
>             // ...
>         }
>     };
>
> Or if (like me) you don't like anonymous functions:
>
>     var Singleton = (function(){
>         var pubs = {};
>
>         pubs.foo = Singleton_foo;
>         function Singleton_foo() {
>             // ...
>         }
>
>         pubs.bar = Singleton_bar;
>         function Singleton_bar() {
>             // ...
>         }
>
>         return pubs;
>     })();
>
> Usage:
>
>     Singleton.foo(...);
>     Singleton.bar(...);
>
> ...but somehow I don't think that's what you have in mind.
>
> FWIW (little, I'm thinking),
> --
> T.J. Crowder
> Independent Software Engineer
> tj / crowder software / com
> www / crowder software / com
>
> On Dec 24, 2:01 am, buda <www...@pochta.ru> wrote:
>
>
>
>
>
>
>
> > Usually we have some fields in a form like date-field.
> > I have a dilemma: in such languages as C# I would create singleton and
> > use one class per many date-fields to display calendar.
> > I dont know is it possible (how to create singleton class and how
> > create ordinary class with static methods and fields) and expediently
> > to make singleton calendar class or have on ordinary calendar object
> > per date-field?
>
> > Help me please

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

Reply via email to