The "begin" and "begin0" forms appear in the racket programs, in the
fully expanded programs and in the bytecode. I expected that in some
intermediate expansion step the "begin0" form expands to a "begin"
form.

For example something like: (This version doesn't work for multiple
return values.)

(define-syntax-rule (my-begin0 first rest ...)
  (let ([temp first])
     rest ...
    temp))

With this expansion the number of different kinds of operations in the
bytecode /virtual machine is smaller, so it would be easier to
maintain and optimize.

My question is: Is this a bad idea because there is a special
optimization for the "begin0" form?

Gustavo
____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Reply via email to