This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Compilation options


Dominique Boucher wrote:

But all this also raises an important question. Can different calling
conventions be used for different expressions in the same module?
Suppose one writes:

(module-compile-options call-convention: 'full-tailcalls)

(define (f x)
  (with-compile-options call-convention: 'cps
     (g x)))

(define (g y)
   ...)

Maybe. That particular example should not have any effect. The full-tailcalls setting applies to the definition of a function. A call uses whatever setting was used for the called function, not the setting for the calling function. At least that's what supposed to happen.


More interesting is:

(module-compile-options call-convention: 'full-tailcalls)

(with-compile-options call-convention: 'no-full-tailcalls
  (define (f x)
     (g x)))

(define (g y)
   ...)

That might work - or it might not. I see no reason why it shouldn't work, with a little bit of care in the implementation.
--
--Per Bothner
per@bothner.com http://per.bothner.com/



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]