In the CoffeeScript program below, I create a subclass of Array
which sets two positions in its constructor:
class SetPositionsArray extends Arr
I realize I'm rather late in the game here, but you shouldn't need to do what you're doing. Here's an example I've been tinkering with and I see no reason why it shouldn't work for you.
class ArrayWrapper
constructor: (name, args...)
@name = name
@push.apply(@, args)
Once this is in place I can do this:
>>> relation = new Relation('foo',1,2,3,4,5)
Object[1, 2, 3, 4, 5]
>>> relation.length
5