Skip to content

Classes? #7

Description

@cf7

Should we implement classes? This issue is tied to dot operators as well.

If we had classes, then we could call functions using the dot operator:

Option 1

var x = [ 1, 2, 3, 4, 5 ];
x.length;

Otherwise, we would have to pass in the thing we are performing the function on.

Option 2

var x = [ 1, 2, 3, 4, 5 ];
length(x);

Option 2 is essentially already implemented for us. We just need to add two lines of code in one file.
Option 1 would require us to implement a whole new feature of having Classes, which wouldn't be that much, but do we have time for that?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions