[Openmcl-devel] string handling question

alex crain alexcrain at mail2.widgetworks.com
Tue Nov 9 15:36:35 UTC 2004


No, not homework :-)

(subseq "asd" 1 2) eventually calls (%substr "asdf" 1 2) once it 
satisfies all it's criteria.
I'm looking for a similar optimization for FIND and friends when the 
argument is a string.

For example,
   (FIND #\s "mystring")
eventually boils down to
   (dovector (a "mystring")
                     (when (eq a #\s) (return a)))
but some implementations of strchr are smarter then that and would do 
things in 4 or
8 byte chunks.

Since I'm working on an OpenMCL editor, implementation dependence is 
not a problem.

:alex


On Nov 9, 2004, at 9:55 AM, Pascal J.Bourguignon wrote:

>
> alex crain writes:
>> Whats the fastest way to implement strchr() in OpenMCL?
>>
>> I can ensure that the types of the arguments will be a constant string
>> and a character.
>
> homework?
> POSITION, FIND
>
> -- 
> __Pascal Bourguignon__                     
> http://www.informatimago.com/
> The world will now reboot; don't bother saving your artefacts.
>




More information about the Openmcl-devel mailing list