[<<][staapl][>>][..]
Thu Apr 5 19:55:49 EDT 2007
nested scope
as i've learned, these features are really necessary to write a
compiler:
* lexical variables
* quasiquotation
* pattern matching
however, they do serve most purpose adapting to a representation that
is inherently imposed, i.e. assembly language syntax. anything that is
non-compositional is better handled with something like scheme.
however, if you can design everything from scratch, it's probably
quote doable to get by with a couple of combinators and aggressive
factoring.
but, in the end, some form of lexical scope should be possible, if
only for the practical problem of name clashes.. there is only one
question. are names functions or values?
in lisp, they are values, because functions are explicitly invoked: if
a variable is in the head of a list, it's a function. in a
compositional language it would involve something like 'i'.
((a b c) locals
... a i ... b i ...)
treating things like values makes them more natural. an abstraction
could be added to do the other (bind as program). then, how to handle
the environments?
NOTE: got lexical variables and quasiquotation working in symcat, but
only by a more direct cat->scheme translation. i dont think it's
really necessary here, since i do most in scheme. also, some name
space issues are still not resolved. maybe i can switch for the next
reqrite tho :)
[Reply][About]
[<<][staapl][>>][..]