The global functions and macros that end up in Globals.pm currently still serve two masters a little bit:
They are slightly preprocessed by the bquote expander (for speed, but also because we don't have Bel's macro-based bquote expander yet)
They are output to screen when someone asks for them
I would like for this to happen:
> all
(def all (f xs)
(if (no xs) t
(f (car xs)) (all f (cdr xs))
nil))
That is, I would like for the value of (e.g.) the all built-in to be printed exactly the way it is in bel.bel.
I mean "exactly the way" in two different senses: (a) exactly those program parts, (b) indented exactly that way.
This could happen in two ways, as far as I can see:
Either store the global functions and macros as strings with the above layout. Generate (and cache) their actual cons cell values whenever someone is curious enough to destructure them.
Or store the cons cell values, but have a way to pretty-print the functions and macros, reproducing the structure in bel.bel exactly.
The first way sounds easier. Maybe it's even more efficient, once we make the loading lazy enough.
The global functions and macros that end up in
Globals.pm
currently still serve two masters a little bit:I would like for this to happen:
That is, I would like for the value of (e.g.) the
all
built-in to be printed exactly the way it is inbel.bel
.I mean "exactly the way" in two different senses: (a) exactly those program parts, (b) indented exactly that way.
This could happen in two ways, as far as I can see:
Either store the global functions and macros as strings with the above layout. Generate (and cache) their actual cons cell values whenever someone is curious enough to destructure them.
Or store the cons cell values, but have a way to pretty-print the functions and macros, reproducing the structure in
bel.bel
exactly.The first way sounds easier. Maybe it's even more efficient, once we make the loading lazy enough.