guile-devel
[Top][All Lists]
Advanced

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

Re: Commercial development


From: Neil Jerram
Subject: Re: Commercial development
Date: Tue, 07 Jun 2005 23:04:07 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Debian/1.7.8-1

Marius Vollmer wrote:
> 
> scm_copy_tree is too much, since it makes the following code fail:
> 
>    (let ((a '(1 2 3))) (letrec ((x a) (y a)) (eq? x y)))
> 
> We should not copy the values themselves, just the storage cells;
> thus, scm_list_copy is the right thing here.

Yes, I see that now.

> But should we make that change?  I am not sure.  It causes some
> significant run-time overhead for an obscure benefit.  For now I'll
> just put in some comments in eval.c and r5rs_pitfall.test.

I'm not sure it's that obscure, and it seems a shame to leave this as
ammunition for those who like to claim that Guile is not R5RS-compliant.

Is it the performance you are concerned about, or the extra consing?
Surely there must be other things we do for "correct Scheme behaviour",
that have a similar cost to a scm_list_copy?

Two further thoughts that could help us here:

(1) If the environment could be made copy-on-write, we could do the copy
only when actually needed.  (But I have no idea whether this is feasible.)

(2) We could provide a 'strict-r5rs option, and use it to decide whether
to do the copy.  (In practice, 'strict-r5rs would probably only be on by
default in Guile's implementation of the SRFI-22 scheme-r5rs interpreter.)

Regards,
        Neil




reply via email to

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