[R6RS] 3 things we may want to vote on

Anton van Straaten anton
Wed Jun 8 20:12:20 EDT 2005


Marc Feeley wrote:
> On 8-Jun-05, at 2:02 PM, Anton van Straaten wrote:
...
>> For the record, I agree with Will's position on this.  That doesn't  
>> actually change my vote, unless this change can be done with the  
>> module system.
>>
>> Anton
>>
> 
> Frankly I don't see how a module system would help in practice while  
> still maintaining the advantages of removing set-car! and set-cdr!  (for 
> example better analysis of the rest parameter list, simpler  
> implementation of some list primitives such as list?).  If it is  
> possible to get at set-car! and set-cdr!, you'd need a whole-program  
> analysis to ensure that the list you care about is not being turned  
> into a circular list, etc.  But that same whole-program analysis  could 
> be applied to R5RS.  I'm clearly missing something here...

I see the potential optimizations as only one aspect of this.  I 
consider merely being able to declare and/or enforce that pairs are 
immutable, even without any optimization benefits, to be useful.

At the level of the spec, set-car! and set-cdr! could be provided as a 
module (perhaps even an optional module).  The optimization issue might 
be addressed in an implementation by having a compiler switch like 
"--enable-immutable-pairs" which tells the compiler that it's OK to do 
the optimizations.  It could then be an error to mix modules compiled 
with different settings.  That's beyond the domain of the spec, though.

This is not a proposal, I'm just explaining the kind of thing I was 
thinking of.  More generally, as I mentioned earlier, my feeling is that 
making Scheme more functional in these sorts of ways would need to be 
addressed in conjunction with other related issues - I don't see it as 
something that can be dealt with one feature at a time.

Anton



More information about the R6RS mailing list