Template:Nasal Constructor inline: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 1: Line 1:
   # constructor, for making new objects
   # constructor, for making new objects
   new: func( {{{2|arg...}}} ) {
   new: func( {{{signature|arg...}}} ) {
   # creates a temporary object that inherits from {{{1|myClass}}}
   # creates a temporary object that inherits from {{{name|myClass}}}
   var {{{4|obj}}} = { {{Nasal Inherit from|{{{1|myClass}}} }} };
   var {{{temporary|obj}}} = { {{Nasal Inherit from|{{{name|myClass}}} }} };
   
   
   # do any other set up here, such as for example
   # do any other set up here, such as for example
   {{{4|obj}}}.message = "Hello World";
   {{{temporary|obj}}}.message = "Hello World";
    
    
   {{{3|print("Creating new object/instance of type/template:{{{1|myClass}}}"); }}}   
   {{{body|print("Creating new object/instance of type/template:{{{name|myClass}}}"); }}}   
   
   
   # return the object to the caller
   # return the object to the caller
   return {{{4|obj}}};
   return {{{temporary|obj}}};
   },
   },

Navigation menu