I have been thinking more about mixfix and its relationship to macro
processing. Actually, this was prompted in part by a weird thought
concerning blocks.

We can view

  let x = 5 in { body }

as a construct in which "{ body }" is a *procedure* taking no arguments,
where the semantics of LET is to apply (call) the procedure. The only reason
to consider this is that it makes code blocks into convenient first-class
objects.

Given which, we could introduce something like:

   mixfix while_do_ : lambda(test, block) {
implementation-of-while-loop-calling-block }

That is: we exploit the fact that lambdas provide a form of call-by-name.

But this got me to thinking about:

  mixfix _and_ : lambda(lhs,rhs) { if rhs then if lhs then true else false
else false }

the problem here is that evaluation under _and_ is lazy, and that requires
either call-by-name or call-by-need (which is memoized call-by-name).

Now the reason I am raising this is that many examples of macros can be
turned into procedures in a language that implements call-by-need.

All of this is a thought for much later in the game, but I wanted to throw
it out and see if anybody thought it was interesting. It's not at all hard
to do.

shap
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to