Sat Apr 4 11:05:53 CEST 2009
* The machine's namespace should be accessible partly. I.e. if the
machine has registers A B C, it should be possible to define an
update using only a sumbset of the registers, with the other
registers left untouched.
* Implementation of sequencing should be completely abstract (on the
macro level). This way it can later be changed from struct ->
struct to values -> values to list -> list or whatever suits the
So, what is necessary?
NAMESPACE: some way of specifying the machine's namespace. This
could be implemented as a struct, list, vector, threaded values...
This needs compile-time identifiers.
UPDATE: parallel assignment defined for the abstract namespace.
Roadmap: first transform current machine's (i.e. in
comp/instantiate.ss and forth/parser-tx.ss to a transposed update
form, then replace with fixed namespace). To do this, perform
automatic transformation of the state-lambda form in
1. trivial syntax-rules -> syntax-case
2. pretty print old form for
* 'update is used explicitly in the state-lambda syntax, probably to
allow for more flexible exit points.
* pattern matching is used on the registers, so the name-based
matching cannot be used, making the two mechanisms (machine
namespace / positional binding + deconstruction) incompatible in
the current form.
('() ;; empty asm
(list asm rs (struct dict (current chain store)))
(struct dict (#f '() store+))
'()) ;; empty rs
(make-dict current chain
(append store+ store))
What about this form, annotated with some redundant visual marker syntax.
;; (field pattern expr)
((asm : '() -> asm)
(ctrl : (list-rest
(current chain store)))
(dict : (struct dict
(#f '() store+))
-> (make-dict current
(append store+ store)))
(rs : '() -> rs))
Advantage here is that it is immediately clear which registers are
modified. A clause (r :) would mean (r : r -> r).
Now.. instead of using fn -> values, isn't it better to use tail
recursion (CPS) instead, and use delimited control to terminate a
sequence of operations?