taskease.js - Tasks: task #12084, Concise constructor arguments

 
 
Show feedback again

You are not allowed to post comments on this tracker with your current authentification level.

task #12084: Concise constructor arguments

Submitted by:  Mike Gerwitz <mikegerwitz>
Submitted on:  Sat 09 Jun 2012 07:00:02 PM UTC  
 
Should Start On: Sat 09 Jun 2012 04:00:00 AM UTCShould be Finished on: Wed 01 Aug 2012 04:00:00 AM UTC
Category: CorePriority: 7 - High
Item Group: DevelopmentStatus: In Progress
Privacy: PublicAssigned to: Mike Gerwitz <mikegerwitz>
Percent Complete: 0%Open/Closed: Open
Planned Release: 0.2.0
Keywords: constructor, classes

Sat 09 Jun 2012 07:00:02 PM UTC, original submission:

To borrow a concept from Scala - the constructor arguments should be able to be specified with the name of the class. This will automatically assign the various arguments to their associated values to cut down on unnecessary code. The details still have to be worked out, but here's the concept. The following code:

Class( 'Foo',
{
'private _a': null,
'private _b': null,

__construct: function( a, b )
{
this._a = a;
this._b = b;
},
} );

could be more concisely written as:

Class( 'Foo', '_a', '_b', { ... } );

Or:

Class( 'Foo' )( '_a', '_b', { ... } );

Or:

Class( 'Foo' )( '_a', '_b' )( { ... } );

Syntax to be decided.

To enforce encapsulation, all properties declared in this manner should be implicitly private.

Mike Gerwitz <mikegerwitz>
Project AdministratorIn charge of this item.

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by mikegerwitz (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 09 Jun 2012 07:01:04 PM UTCmikegerwitzPlanned ReleaseNone=>0.2.0
    Sat 09 Jun 2012 07:00:13 PM UTCmikegerwitzAssigned toNone=>mikegerwitz
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup