Implementation
How cola is implemented in ActionScript semantics Lambda expression (lambda (a) (let ((a "inner")) a)) function (a) { with({ a : "inner" }) { return a } } Structure (tuples) (define-structure pair (head tail)) public class typeof-pair { private var head; private var tail; public function pair-head () { return this.head; } public function set-pair-head (value) { this.head = value; } public function pair-tail () { return this.tail; } public function set-pair-tail (value) { this.tail = value; } } Generic function (define-generic next (self) (error "next is not defined in " self)) (define-method next typeof-byte-stream (lambda (self) ...)) function next (self) { self["*m*-next"](self); } typeof-byte-stream.prototype["*m*-next"] = function (self) { ... }