mit-scheme-devel
[Top][All Lists]
Advanced

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

Re: [MIT-Scheme-devel] two changes to push


From: Chris Hanson
Subject: Re: [MIT-Scheme-devel] two changes to push
Date: Sat, 19 Sep 2009 15:21:18 -0700

It's worth the trouble in some situations.  Generally I only use it
when the parameters are referred to exactly once, or when I know that
the arguments are always simple expressions without side effects.

There is code in the compiler to optimize expressions of the form
((lambda (x) ...) y), but as I recall it's slightly buggy, so I don't
trust a simple integrate-operator declaration to do the right thing.

Sometimes there are situations that integrate-operator would expand into

    ((lambda (x) ... x ... x ...) (car y))

In many cases it's beneficial to optimize this into

    ... (car y) ... (car y) ...

but the compiler won't do that, while define-integrable will.

Some basic discussion in case you haven't seen it:

    
http://www.gnu.org/software/mit-scheme/documentation/mit-scheme-user/In_002dline-Coding.html#In_002dline-Coding

On Sat, Sep 19, 2009 at 2:54 PM, Taylor R Campbell <address@hidden> wrote:
>   Date: Sat, 12 Sep 2009 09:46:16 -0700
>   From: Joe Marshall <address@hidden>
>
>   I did integrate-operator because the argument `object' is duplicated.
>   The slightly better job is offset by the potential for bugs later on.
>
> I didn't realize until you said this that DEFINE -> DEFINE-INTEGRABLE
> changed the semantics of programs.  Is this worth the trouble?  For
> those cases when it doesn't change semantics, does it actually improve
> the code that the compiler generates?
>




reply via email to

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