LFE Object System
Erlang Makefile
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 13 commits ahead of oubiwann:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


LFE Object System Build Status


LOS is inspired by CLOS. It may or may not provide macros for more than one object system. We shall see.

When referring to the plural form, we recommend the Spanish "los LOS". In the singular form, "el LOS", "the LOS" or just "LOS" are all acceptable. LFE LOS may have been named after the definite article, or the town in Sweden, or the crater on Mars.

Feel free to also make "loss" puns. These will be quite amusing for all, and apropos.

More seriously, the initial implementation will be taken from Peter Norvig's PAIP, Chapter 13 as well as ideas implemented in Clojure.

Why OOP?

Blame it on cadar; he made me do it. But before that, there was this, so I guess it can't all be laid at his feet.

Peter Norvig said it best (especially when we take it out of context):

"Object-oriented programming turns the world of computing on its side..."

And now that we've got a doubly-functional programming language (Lisp + Erlang), we're going to turn it over on its other side.

The reason this project is blamed on cadar is that he made a very good argument that 1) there are definitely valid use cases for OOP (or AOP), and 2) we should offer people that flexibility.


Development Plan

First, we're going to start with a simple knock-off of CLOS as developed by Peter Norvig in PAIP, Chapter 13. This will be done using classic lambda closures. Next, we'll look at using processes instead of lambdas for closures. This is defnitely the more Erlang-y way to do it, but it may be more inefficient for many uses. Then, we may look at Clojure's protocols and add support for that. After this, the sky's the limit. Or maybe not. Who knows?

lambda Closures

  • defclass -


This project assumes that you have rebar and lfetool installed somewhere in your $PATH.


Just add it to your rebar.config deps:

    {deps, [
        {los, ".*", {git, "git@github.com:lfex/los.git", "master"}}

And then do the usual for your lfetool-created project:

    $ rebar compile

This will automatically download the project deps and compile them before also compiling LOS.


To be done ...