Arc Forumnew | comments | leaders | submitlogin
2 points by rocketnia 5188 days ago | link | parent

Oh, I implemented 'def-extension-type in lathe.js as lathe.deftype().

  // Define a constructor _.Seq and a rulebook _.iffirstRb.
  lathe.deftype( _, "Seq", "iffirstRb" );
  
  // Define a constructor _.Seq using an existing rulebook.
  lathe.deftype( _, "Seq", _.iffirstRb );
This is not to be confused with the 'deftype I was talking about in that thread. >.>

I use it in exactly two places so far, and the rest of the time I've been cheating by defining types in a more traditional OO JavaScript way. But I'm totally interested in figuring out things like this that could help. I think Traits.js is a pretty interesting option for this, and I'm not against message-passing at this point either. ^_^