Abandoned

Since infogami has been abandoned by its creators, I’m out too. Back to web.fisher.cx for me. Everything that was here is there.

Robert Fisher

Just thinking out loud

Things for Scheme

If you register and log in you can add comments to my pages. If viewing the main blog page, click the # underneath an entry to comment on it.

An OOP system in Scheme. Nothing original. Just me trying to learn more about Scheme & implement objects as I'd want them to work.

Features:

  • Things expose only methods. Not even subclasses get access to instance data. (Although, I'm less intested in preventing access to instance data as much as not providing it.) Of course, you can provide accessors to effecively expose instance data.
  • Things are closures.
  • Inheritance & polymorphism. (Duh!) (Although, does polymorphism really mean anything without strict typing?) Multiple inheritance. (Prototype-ish)
  • Dynamic typing.
  • Reflection. (Which really only means that a thing can answer questions about what methods it supports.)
  • No multiple dispatch. (At least not right now.)
  • The ability to handle unmatched methods. (Thus, easy delegation.)

Right now this is just a library for Scheme, but I could see writing a compiler for an everything-is-an-object (everything-is-a-thing (^_^)) language based on this.

I plan to build more abstract syntax on the current implementation. Right now, I'm only concerned about implementation details.

The current implementation relies on fluid-let. This may be a bad thing.

Should it be possible to add a method to an existing thing? (Such methods would not have access to instance data except through existing methods.) Subclassing can do this, but it might be nice to add to an existing thing. It is possible to add a parent to an existing thing! (Whether I want to keep this or not has implications in a few bits of the current implementation.) If I do want this (whether it is dynamically adding a parent or dynamically adding just a method), it could be up to the thing to expose that functionality through a method or keep it unaccessible.