[<<][staapl][>>][..]
Mon Apr 7 07:36:13 EDT 2008

quoting and meta-code

the problem: quoted labels. somewhere down the line, quoted words
loose their quoted tag, such that macro evaluation doesn't give what's
needed.

' abc 1 + jump

what about getting rid of the symbolic part, and starting with clean
semantics?

 (([qw a] [qw b] +)    ([qw (macro: ',a ',b +)]))

this doesn't work of course, because it recurses.. so what would work?
schould it be scat code?

 (([qw a] [qw b] +)    ([qw (scat: ',a ',b +)]))

what is the semantics of a quoted scat word? can it be just a thunk?

 (([qw a] [qw b] +)    ([qw (lambda () (+ a b))]))

thunks are most flexible, but would it be good to limit the semantics
to somehow scat words or macros?

let's restate the goals:
  * obtain a value at assembly time.
  * allow easy composition of meta-code at compile time
  * allow meta code inspection
  * simplify definition of meta-ops (snarfing)

 (([qw a] [qw b] +)    ([qw (scat: ',a ',b +)]))

maybe i need to give up on inspection, and solve that
later. concentrate on semantics first.

   [qw <thing>]

what is <thing>?

it's any VALUE that makes sense at compile time, to be passed around
between macros, but eventually, it should end up as a number.

what is composition of meta code?

in the previous approach, this was done syntactically: just
concatenate lists. is this still a good approach? isn't a more general
abstract approach better?


 (([qw a] [qw b] +)    ([qw (meta: a b +)]))

now, what does 'meta:' do ?

  * produces a single (delayed) numerical value
  * the '+' comes from scat namespace
  * the 'a' and 'b' are lexical parameters.

ok. got it in macro/meta.ss : simple layer on top of scat code which
appropriately quotes lexical variables, and wraps results in a meta
structure to chain evaluation.

seems to work with the pic18 stuff too.

now: meta annotation. something that might come in handy is to figure
out where assembler literals come from. in the old brood, code was
just symbolic. here it needs to be annotated explicitly, because that
information is lost.

problem: meta code has to be thunks: the value can depend on numerical
addresses of words, which might change during the relaxation phase of
the assembler.


[Reply][About]
[<<][staapl][>>][..]