Wed Apr 29 18:00:49 CEST 2009
units and macros
There is one thing i didn't understand when starting with units: it is
not so straightforward to use transformer bindings. Maybe it isn't
the abstraction I'm looking for after all.
It's a bit obvious that you can't separately compile things and later
fill in compile time dependencies.
I'm missing some intuition again. Where do I put the parsing words
and the type info?
I need another abstraction.
Now, the wordlists were a good idea. Can they be combined with some
other macro-based linking form?
After reading this again:
"Each id in a signature declaration means that a unit implementing
the signature must supply a variable definition for the id. That
is, id is available for use in units importing the signature, and
id must be defined by units exporting the signature.
"Each define-syntaxes form in a signature declaration introduces a
macro to that is available for use in any unit that imports the
signature. Free variables in the definition’s expr refer to other
identifiers in the signature first, or the context of the
define-signature form if the signature does not include the
It seems quite clear that yes units only link _variable_ declarations
and inside the unit's body it is possible to use syntax depending on
some of the variable bindings, but this syntax needs to be tied to the
signature's compile time data.
Now, how does this relate to parsing words. When are they necessary?
Only in .f code. S-expressions don't need them, as they can use pure
* The basic composition part in Staapl is still the module, but it
is possible to create modules from units.
* For ops the signature contains compile-time data for type
checking so this problem should be solved.
* Abstracting macros becomes difficult.