LANGUAGE MIX | OBJECT ORIENTED | Interpreters adjusts ideas

Octo Fraguto octo at fraguto.com.br
Sun Aug 21 18:28:10 PDT 2011


This is just some ideas that I had
when I was using another languages.

var obj = {
    /*
        @author author
        @version 0.04
        @doc """
                lorem ipsum sit imet
             """
    *///document controllers
    construct: function(){
        //executed when enters memmory
    },
    foo : "",//commmom attribute
    /*
        do
            obj.foo = 10;
            console.log(obj.foo);
        the same of
            obj.foo.set(10);
            console.log(obj.foo.get());
        when the methods below are made
    */
    foo.get = function(){
        return this.foo;
    },
    foo.set = function(bar){
        this.foo = bar;
    },
    m = function(){
        /*implicit list compare:
            the same of
             if(x==0||x==1||x==2)
        */
        if(x==[0,1,2]){
            /*do something*/
        }
    },
    destruct: function(){
        //executed when leaves memmory
    }
}.extends(anotherObject).final();
/*
    extends integrates the content of anotherObject into obj
    final makes obj unextendable
*/

Are there any opinions?


 *T. Octávio             *
*Visite Me: **http://fraguto.com.br*

<http://fraguto.com.br/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110821/d5dc2b79/attachment.html>


More information about the es-discuss mailing list