[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: minimal CPS program?

From: Matt Wette
Subject: Re: minimal CPS program?
Date: Tue, 22 May 2018 19:48:25 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

On 05/21/2018 08:25 PM, Matt Wette wrote:

Hi All,
I'm trying to compile a minimal cps program.

Here is something that compiles:

(define (doit)
  (parameterize ((label-counter 0)
                 (var-counter 0))
    (with-cps empty-intmap
      (letv init)
      (letk kinit ,#f)
      (letk ktail ($ktail))
      (letk kbody ($kargs () () ($continue ktail #f ($values ()))))
      (letk kclause ($kclause ('() '() #f '() #f) kbody #f))
      ($ ((lambda (cps)
            (let ((init (build-cont ($kfun #f '() init ktail kclause))))
              (with-cps (persistent-intmap (intmap-replace! cps kinit init))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]