[Larceny-users] Commutativity

Jed Davis jdev at panix.com
Fri Feb 23 14:23:33 EST 2007


On Mon, Feb 12, 2007 at 11:58:48AM -0500, William D Clinger wrote:
> Jed Davis wrote:
[]
> > 1. The op2imm seems to come from cg-integrable-call2 in pass4p2, which
> >    could also check on the constancy and immediate-worthiness of the
> >    first argument.
[]
> Generally speaking, I think it's best to handle
> this sort of thing through a source transformation
> as early as possible, e.g. pass 2 or 3.  As of now
> I don't think commutativity is used to enable
> op2imm, and is not recorded declaratively.

My thought there was just that the sidedness of op2imm is an artifact of
the MacScheme machine -- which, to be fair, it shares with many actual
machines -- and thus it might not be considered proper to make an earier
pass care about the resulting difference between (+ x 2) and (+ 2 x).

-- 
(let ((C call-with-current-continuation)) (apply (lambda (x y) (x y)) (map
((lambda (r) ((C C) (lambda (s) (r (lambda l (apply (s s) l))))))  (lambda
(f) (lambda (l) (if (null? l) C (lambda (k) (display (car l)) ((f (cdr l))
(C k)))))))    '((#\J #\d #\D #\v #\s) (#\e #\space #\a #\i #\newline)))))



More information about the Larceny-users mailing list