String is: ByteArray?
Brian Rice
water at tunes.org
Thu Dec 30 08:20:59 PST 2004
On Dec 30, 2004, at 5:40 AM, Lendvai Attila wrote:
> So my question is: is it a temporary bootstrap solution that String is
> a ByteArray or is there some intention in it? I've added a KLUDGE
> comment to the two extra methods that they are only there because of
> this fact.
Yes. The internationalization code is expected to turn it into a real
Sequence once it is fully integrated (bootstrapped in).
> Later today I'll check in my changes which include:
> - encode:/decode: protocol for ExternalResources
> - some refactoring in ER to use optionals
> - Terminal line editing fixes
>
> There is only one issue left for the Terminal code that I'll fix later
> today (wrapping lines) and it'll be done as far as I can see. Line
> editing mostly works, except that I don't know what is 'yank' and
> 'killbuffer' and therefore what the code is supposed to do.
Yanking and kill buffers are the emacs style of cutting and pasting.
Here's a random URL to explain:
http://homepages.gac.edu/~mc38/2001J/documentation/gnuemacs/node10.html
We don't have to do it this way, but this is how linedit accomplished
it, so it just got carried over. I'd prefer something as object-y as
possible, to use the command system from the ui, but that's not ready.
> What is left to do is to integrate it with the parser. Line editing
> supports continuing the edit in case it's desired. It should work so
> that when an enter is pressed the parser is called. If the parse
> fails, the cursor should be put at a useful position and editing
> should continue.
To be specific, you need to teach the REPL how to use the Parser.
"Integration" is too strong a word. The REPL just /uses/ the Parser to
check code, and if it's valid, it then /uses/ the Compiler and
evaluates it and then /uses/ the printer to show the user what was
there.
> I'll try to call parser on: line and if it fails to parse an
> expression and consume all chars then reset the parser and continue
> editing. Or something like that... Lee, if you have some ideas... :)
I think that's just where the new parser interactiveMode is intended to
be used. What the parser also needs is a way to communicate a
structured exception to show where exactly some dynamic parsing error
happened (presumable the cursor should be placed there).
Note that for highlighting, you basically just need to lex the text and
run a modified parser which spits out parseNodes with specific
positions in the text (and then visit those positions to highlight
based on a style). This is exactly what Squeak's Shout does, although
it's not very readable code.
--
Brian T. Rice
LOGOS Research and Development
http://tunes.org/~water/
More information about the Slate
mailing list