[squeak-dev] Re: CharacterScanner and stopConditions

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Thu Oct 10 01:26:20 UTC 2013


There is however something lacking for making primitive 103 or cousin work.
A primitive has no idea of how to reach #endOfRun and #crossedX symbols, so
answering hardcoded symbols is of no help, they must be registered
somewhere...

A possibility would be to answer the index. For example, we could encode a:
    stopHelper := (1 to: stopConditions size)
        collect: [:i | (stopConditions at: i) ifNil: [i-1] ifNotNil:
[i\\256]]
        as:ByteArray.

Then test in the inner scan loop:
    (stopHelper at: i + 1) = i ifFalse: [^i + 1]

and in the outer loop:
    [stopIndex := self scanWithHelper: stopHelper.
    self perform: (stopConditions at: stopIndex)] whileFalse.

That would mean restoring some kind of TextStopConditions managing both the
258 stopConditions and the stopHelper... A bit too much to my taste. I
think it's too late for my brain ;)


2013/10/10 David T. Lewis <lewis at mail.msen.com>

> On Thu, Oct 10, 2013 at 02:23:00AM +0200, Nicolas Cellier wrote:
> > I propose to commit, and tim tries the performances on the Pi.
> > If ever someone yells, we'll roll back.
>
> You guys make a great team :-)
>
> Dave
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20131010/08fba775/attachment.htm


More information about the Squeak-dev mailing list