Juan Vuletich | 1 Jun 2011 03:19

Re: smalltalk evolution

info <at> tomsik.cz wrote:
> In short:
>
> 1.) binary messages make sense only for math. I've never implemented 
> even one binary message, have you? (for non-math things) 

That's not true (the first part. I don't know what you have ever 
implemented).
For instance look for implementors of  #=, #==, #>, #>>, #->, #+, #,, 
#&, #|.

This is a nice example of something I have implemented:
    Text
        buildWithStyles: ({
            #H3 -> (ParagraphStyle named: 'Heading 3').
            #b11 -> (CharacterStyle named: 'Blue 11').
            #r10b -> (CharacterStyle named: 'Red 10 bold').
            #g11i -> (CharacterStyle named: 'Green 11 Italic')
            } as: Dictionary)
        contents: [ :builder |
            builder , 'Starts with no character style. But later gets' < 
#b11 , ' small and blue' , ' and stays like that. Then' >< #r10b , ' 
emphasized and inside this,' < #g11i , ' green and italic' > ' for a 
while. Later' > ' back to Heading 3.' / #H3].

The objectives for this were:
- the styles can be crated dynamically, and there's no need to add new 
selectors for new styles
- it is very unobtrusive, the text is reasonably easy to read (much 
nicer than, for example, rtf or html), especially with Shout.
(Continue reading)


Gmane