Published
Edited
Sep 7, 2021
10 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
ev('(backtrace)')
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
f_do = {
const skipMarker = Symbol.for('SKIP');
const f_do = async (world, form) => {
console.log('DO');
const oldform = symbolp(car(form));
const once = cadr(form) === null;
const [nspecl, ntestl, ...nbody] = [...iter(form)];
const [ovar, oinit, ostep, otest, ...obody] = [...iter(form)];
const specs = oldform ? [list(ovar, oinit, ostep)] : [...nspecl];
const vars = specs.map(car);
const inits = await evalList(world, specs.map(cadr));
const steps = specs.map(s => (cddr(s) ? car(cddr(s)) : skipMarker));
const [ntest, ...nexitforms] = oldform ? [] : [...ntestl];
const test = once ? LSymbol.T : oldform ? otest : ntest;
const exitforms = oldform ? null : nexitforms;
const body = oldform ? obody : nbody;
const frame = new ApplyFrame(LSymbol.DO, null);
const do_do = async () => {
frame.applyBindings(vars, inits);
while (true) {
if (await world.eval(test)) {
return world.prognBody(exitforms || null);
}
await world.prognBody(body);
let i = 0;
const nvals = [];
for (const nvar of vars) {
const step = steps[i++];
if (step !== skipMarker) {
const nval = await world.eval(step);
if (nvar) {
nvals.push(nval);
}
}
}
frame.applyBindings(vars, nvals);
}
};
return world.withFrame(frame, do_do);
};
return f_do;
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
toPath(await L`((teach) lesson progn)`)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
TEACH = PATCHES.ev(`
(progn

(load "attach;boot")
;; Resolve MACAID/DEFMAX circular dependency
;; This will be ovdrwritten by the real definition in MACAID
(defmacro defsimplemac (name varlist &body body)
\`(defmacro name ,varlist, ,@body))

(load "lisp;macaid")
;; SETF has way too many irrelevant dependencies, many of them circular.
;; I've decided implementing my own is far simpler.
;;(load "nilcom;setf")
(load "teach;start")
)`)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Inspector = (await require('@observablehq/inspector')).Inspector
Insert cell
typeof Inspector.Inspector
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more