Arc Forumnew | comments | leaders | submitlogin
1 point by akkartik 3283 days ago | link | parent

Remind us, what is alet? I tried reading http://letoverlambda.com/index.cl/guest/chap6.html but it uses vocabulary from previous chapters, like dlambda.


2 points by rocketnia 3282 days ago | link

Hmm, looking at the implementation, 'alet is a utility for wrapping a lambda to do various things:

a) The letargs let you set up some bindings the function can refer to.

b) The body lets you do some things with the function in scope before returning it.

c) It wraps the function in a mutable binding named 'this, and it actually returns another function that dereferences this binding and calls whatever's inside. That way you can dynamically replace the entire behavior of the function by assigning to 'this.

So it seems to be geared for a certain object-oriented style where objects have a) private fields, b) a programmable constructor, and c) a private "become" operation.

It looks like 'dlambda is some kind of a multi-branch, destructuring lambda. In this context of this object-oriented style, it effectively lets your object have multiple methods.

-----