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

Re: Shared substrings

This page is part of the web mail archives of SRFI 13 from before July 7th, 2015. The new archives for SRFI 13 contain all messages, not just those from before July 7th, 2015.



In article <lhug0ryz4z1.fsf@xxxxxxxxxxxxxxxxxxx>,
erik hilsdale <ehilsdal@xxxxxxxxxxxxxx> wrote:

>I wish that I could treat the three elements of a substring as one
>argument and yet be guaranteed it would be passed in three
>registers/framelocs/whatever in the common non-heap-allocated case.
>That is, I wish Scheme had/required ML's tuple unpacking.  It (the
>language, and all implementations of it that I'm aware of) doesn't and
>it (the language) never will.
>
>But I sometimes need the speed that such unpacking would give me.

This is silly. If you really need the extra speed, then use a Scheme
implementation with shared substrings, or another language (such as C).

>  ms> However, I have a compromise idea. Instead of the optional START
>  ms> and END parameters, allow using a list '(s start end) instead of
>  ms> the string parameter. 
>
>I'm not sure I understand how this is a win over the optional
>start/end parameters,

The advantage is that you can store the string with the indices as one
(conceptual) unit, thus making the program code easier to maintain and
less error-prone.

Please don't destroy the nice high-level Scheme language with these
exaggerated low-level optimazion efforts.

---
/****************************************************************\
* You have just read a message from Mikael Ståldal.              *
*                                                                *
* Remove "-ingen-reklam" from the address before mail replying.  *
\****************************************************************/