Hello, On Mon, Jun 17, 2013 at 1:14 PM, Andy Wingo wrote: > > So it's exactly like `let', then? ;) > Oh, yes, you're right. :-) > > > I think we could make CSE work with this, don't you think? > > Oh sure. It works with let already. It's just not as effective. > > To translate this into CPS, I think you need a form that introduces a > > continuation for every unspecified-order clause and then merges them, > > like this: > > > > (let ((foo-cont (lambda (A C) (foo A C)))) > > (let-merge-points ((A A-cont) (C C-cont)) > > (let ((make-A ((lambda () (a (b))))) ;; not CPS-translating this > > (make-C ((lambda () (c (d)))))) > > (any-order (make-A A-cont) (make-C C-cont))))) > > > > Here let-merge-points introduces several continuations, and any-order > > calls them in any order. What do you think? > > It's tough for me to read this example. Does it have some strange > formatting? > Yes, I'm using a webmail client. The formatting probably got messed up there. In retrospect, that's too complicated anyway. I think we can make something very much like a `let' work in CPS, but I realize that's not ideal. > If I understand correctly, I think this is going in the wrong > abstractive direction -- CPS is nice because it's a limpid medium for > program transformations that also corresponds neatly to runtime. With > this sort of thing we'd be moving farther away from the kind of code we > want to emit. Dunno. > I think there's sort of a fundamental problem here - the point of leaving the order undefined is that we don't know what code we want to emit yet, so we might have to move further away from emitted code. But I also don't think that's a bad thing as long as it's for something that's really useful, like reordering function arguments. What do you think? Noah