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

Re: [Scheme-reports] Procedural equivalence: the last debate



On Wed, Jun 5, 2013 at 10:42 AM, John Cowan <cowan@x> wrote:
Alex Shinn scripsit:

> Is the idea basically to transform:
>
>   (let ((f (lambda ...)))
>     (... f ...)
>     ...
>     (... f ...))
>
> into:
>
>   (let ((f (lambda ...))
>          (location (generate-unique-value)))
>     (... (box f location) ...)
>     ...
>     (... (box f location) ...))

Just so.

> Using addresses wouldn't work, generate-unique-value
> would have to increment a global counter (which need
> not be unique to this location).  Though if the counter
> ever overflows into a bignum all optimization is lost.

Just use the address of any one copy of the procedure.

By definition of the optimization, those addresses only exist
conditionally and can't be referenced by the other addresses.

If any address is being uniquely generated the whole point
of the optimization is lost.

-- 
Alex

_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports