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

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

Re: [MIT-Scheme-devel] SUBSTRING and SET-STRING-MAXIMUM-LENGTH!


From: Joe Marshall
Subject: Re: [MIT-Scheme-devel] SUBSTRING and SET-STRING-MAXIMUM-LENGTH!
Date: Sat, 5 Sep 2009 21:50:24 -0700

I just pushed a change that restored everything to the way it was.
I'll try to figure out a way to implement string-head! that is portable.

On Sat, Sep 5, 2009 at 5:21 PM, Chris Hanson<address@hidden> wrote:
> I'd also write STRING-HEAD! in Scheme.
>
> For that matter, writing STRING-MAXIMUM-LENGTH and
> SET-STRING-MAXIMUM-LENGTH! in Scheme would probably improve
> performance.  Inlining the Scheme code would be equivalent to
> open-coding.
>
> On Sat, Sep 5, 2009 at 4:38 PM, Taylor R Campbell<address@hidden> wrote:
>>   Date: Sat, 5 Sep 2009 16:29:27 -0700
>>   From: Joe Marshall <address@hidden>
>>
>>   I assumed that SET-STRING-MAXIMUM-LENGTH! was called for
>>   efficiency reasons, otherwise SUBSTRING would work just fine.
>>
>> I imagine that the time to set a string's maximum length and then read
>> it is negligible; what's important is the time to copy a string large,
>> and the pressure it puts on the garbage collector.
>>
>> As an aside, I just noticed that STRING-MAXIMUM-LENGTH and
>> SET-STRING-MAXIMUM-LENGTH! are not open-coded.  Is there a reason for
>> this, beyond just that nobody wrote open-coders for them?
>>
>



-- 
~jrm




reply via email to

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