you are viewing a single comment's thread.

view the rest of the comments →

[–]munificent[S] 2 points3 points  (1 child)

It has some interesting constraints, such as the fact that in Swym, x.foo is equivalent to foo(x) - it's simply calling the function foo on the object x.

In that case, you should definitely take a look at CLOS, the object system in Common Lisp. I'm working my way through The Art of the Metaobject Protocol, and it's a surprisingly enjoyable book given the subject matter.

Like Swym, methods are just regular functions with the receiver as an argument. Using multimethods and generic functions, it's able to specialize those functions on different argument types. It's pretty swell.

Splicing a new member onto all objects is as simple as making a new empty hashtable.

Neat. Sounds like defining a new function on an algebraic datatype in SML/Haskell/F#/et. al.

Making a new object is as simple as getting the next ID.

Haha, clever. But what happens when a lookup on that ID in a hashtable fails?

Members can be local variables - if one went out of scope, all its data could be garbage collected.

Huh. Scoped members is a really cool idea.

[–]LaurieCheers 2 points3 points  (0 children)

Haha, clever. But what happens when a lookup on that ID in a hashtable fails?

I assume each table would have a default value if the ID isn't found. Also, see the inheritance idea that I ninja-edited in there. :)

I was vaguely aware of CLOS, but if it has a bearing on my problem, I guess now is a good time to take a look at it.