How to use: [Bind] defines variables; in particular, it allows you to store computation results [Eval] asks for an expression and evaluates it; when evaluation finishes, the result is in the form of a pointer, which you most likely want to give to "Write" and/or "Bind". [Stop] interrupts evaluation in case of an infinite loop [Write] displays memory contents in s-expression format [GC] runs garbage collection [Setup] = green-flag, resets [Show/Hide] shows/hides memory stop-sign stops speech bubbles Main changes since v1: Made documentation in the "overview" sprite Added (broadcast name args) to call Scratch code Added library procedures for metaprogramming: (proc-type obj); (proc-params proc); (eval-in-env-from closure expression) Made a diver figure appear during garbage collection, to see how much time is spent on garbage collection Library function list: (eval-in-env-from closure expression) interprets expression as code and evaluates it in the environment captured by closure (proc-type obj) returns a symbol: primitive if obj is a primitive procedure, closure if obj is a closure, continuation if obj is a continuation, f otherwise (proc-params proc) if (proc-type proc) is not f, returns proc's formal parameter list; if (proc-type proc) is f, returns f Primitive function list: (apply fn args) calls the function fn; args is a list containing the arguments to be passed to fn (broadcast name args) sends the broadcast whose name is "link {name}": e.g., (broadcast "hello" args) broadcasts "link hello"; for more on how to connect scripts to this, see inside in the "overview" sprite (call/cc proc) "call with current continuation" calls the function proc; fn must have one parameter; the argument passed to proc is a function of one parameter, the "continuation", which when called returns its argument "out of" this call to call/cc (car a) a must be a pair; car returns its first element (cdr a) a must be a pair; cdr returns its second element (cons a b) creates a pair (a . b) (eq? a b) returns the symbol t if a and b refer to the same memory location; returns the symbol f otherwise; in particular, eq? always returns t on two symbols with the same name, but does not always return t on two strings with the same content (pair? obj) returns t if obj is a pair; returns f otherwise (string? obj) returns t if obj is a string; returns f otherwise (symbol? obj) returns t if obj is a symbol; returns f otherwise Also see the v1 Notes and Credits: