This post originated from an RSS feed registered with Agile Buzz
by James Robertson.
Original Post: The Return of the Arrow
Feed Title: Travis Griggs - Blog
Feed URL: http://www.cincomsmalltalk.com/rssBlog/travis-rss.xml
Feed Description: This TAG Line is Extra
Tonite, I played some more with Ambrai Smalltalk. More coolness. Some more observations as I growsed around the system, and then again, something fun.
Fonts - To render a string with in color, or bold, or italic or a specific font, 3 classes get involved from the programmer's perspective: Text, TextStyle, and Font. That's it. Pretty tactile and straightforward. Ever since rewriting ExtraEmphases, I've been looking for good examples of simple and approachable string rendering APIs. This one is a good one.
Contexts - That I know of, there are two Smalltalk's that can model contexts in a reflective enough fashion to do what SeaSide does. So I'm interested to see if Ambrai will have what it takes. I don't know yet. It does have an ExecutionContext which you can chain through, ask for the selector or method or reciever, look at it's arguments. It's accessed not via 'thisContext' but via ObjectMachine current currentExecutionContext. I don't just how reifable they are, whether you can copy them, restart them, etc. This is an area many "simple" Smalltalk's definitely skimp on, the amount apparently there is impressive.
Platforms - This is an OSX tuned platform, right? So what are those methods in ObjectMachine 'testing-processor' and 'testing-operating system' for? isPalmOS? And the method comment for applicationHandle? Maybe it's just a long heritage's accumulation over the years. Maybe there's more there.
Encoders - It's just the various UTF schemes How refreshing. And, external streams are basically binary with an encoder around them. As it should be.
Warning: Past this point there be "weird characters", browsers may not render correctly
My first Smalltalk book was the Blue Book. I was totally mystified by the syntax. It was mysterious and alluring:
foo
↑foo
What was that about? The same word separated by a symbol I couldn't even type and it was supposed to mean something basic. It seemed so transcendental. I truly did feel as I stood on the island watching an etheral balloon floating away's up there. Ever since I figured it out though, I've always wanted to return to that transcendental plane. I want to code with the left and up arrows. I want to look at my code and think "that's so other worldly".
How hard was it to make Ambrai do this? Not hard at all. Ambrai being a small/new project, it hasn't accumulated years of Scanner hacks and attempts and renditions. There's just one, and it's pretty clean. I modified two methods (scanReturn and scanToken) and added a third (scanLeftArrowAssignment). isAssign was added to Character. And Character's isReturn was modified as well. I had to fire up the OSX Character Palette to actually input the characters (does anyone know some way to "map" these characters so I don't have to use the palette). But that's it. So I rewrote one of my favorite methods:
Symbol>>value: anObject
↑anObject perform: self
Not much different, but that's an up arrow. To test assignment, I wrote another one of my favorite base extensions:
The only thing left after that, was to fix my formatter from last night. I modified the SmalltalkPrettyPrinter to emit the left and up arrow and all was well again. I can now input code in either format. When I "format" it, will be transcended.
BTW: This blog means that my Upgraders Beware blog issues have been resolved. I reinstalled clean.