Re: [racket] A primitive more fundamental than a continuation?

2012-12-02 Thread Jan Burse
Galler schrieb: 'Racket could implement mutable continuations, but has not' I was just thinking whether mutable continuations can be used for some JIT-ing. Had already a question about call-site code replacement here. And there some response was to use set! on a symbol. But using set-car! looks

Re: [racket] Call-Site Code Replacement

2012-10-29 Thread Jan Burse
ne the-f f) (define (g a) (printf "(g ~a)\n" a) (set! the-f f) 1) (module+ main (for ([i (in-range 10)]) (the-f i))) OUTPUT: (f 0) (g 1) (f 2) (g 3) (f 4) (g 5) (f 6) (g 7) (f 8) (g 9) On Mon, Oct 22, 2012 at 11:55 AM, Jan Burse wrote: Dear All, I just wonder whether

[racket] Call-Site Code Replacement

2012-10-27 Thread Jan Burse
Dear All, I just wonder whether it is possible in a functional language to do call site replacement. I envision this as a special form of lazyness. Basically I would call somewhere a function f with an argument a: ... (f a) ... The function would then manage to replace itself by a function