This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Scarab Lisp interpreter. Runs Scarab-∞ in ANF with full first class continuations. | |
* | |
* This is a CEK machine, with *mutable* environments. (so remember to migrate to CESK for formal work, derp). | |
* | |
*/ | |
import { Let0, Lit, VarRef, App, If, SetQ, Fn, CallCC, RuntimeEnv, Var, Env, AExp, Exp, PApp } from "./ir"; | |
import { NIL } from "../scarab-core/lists"; | |
export const STEP: unique symbol = Symbol("step"); | |
export const AEXP: unique symbol = Symbol("aexp"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { observe, unobserve } from "@nx-js/observer-util"; | |
export const observer = (klass) => { | |
let kp = klass.prototype, | |
cwm = kp.componentWillMount, | |
cdu = kp.componentDidUnmount; | |
kp.componentWillMount = function() { | |
this.render = observe(this.render, { scheduler: () => this.setState(), lazy: true }) | |
cwm && cwm.apply(this, arguments); | |
} |