Fear and loathing of the "perlification" of Smalltalk

stephane ducasse stephane.ducasse at free.fr
Wed Sep 5 12:40:04 UTC 2007


Would be a nice evolution for smalltalk.

I always wanted to look at the way lisaac is doing infix and other  
notation (but it should not be that powerful).

On 5 sept. 07, at 04:02, Andreas Raab wrote:

> Peter William Lount wrote:
>> I wonder Alan, if you could, expand on what you mean by "but it  
>> needs to be done at the same level as regular programming (so it  
>> can be used by any base version of the language)"?
>
> Isn't that obvious? When you add the method #frobler to Object you  
> extend the language. And at the same level as regular programming.  
> For example, one could consider implementing operators that way,  
> say in a Prolog style, priority driven way:
>
> Object>>plus: anObject
>     <operator: #+ type: #yfx priority: 500>
>
> Object>>minus: anObject
>     <operator: #- type: #yfx priority: 500>
>
> This implements all the semantics as plain messages but leaves  
> operators as syntactic sugar on top of them. The compiler would  
> translate "a + b" into "a plus: b" and the decompiler -if it knows  
> about the plus operator in your system- would decompile as #+. If  
> it didn't know about it, it would decompile as #plus:. Your code  
> would depend on the "PlusMinus" package that other people have to  
> load (since it contains the operator definitions). Etc. It's pretty  
> straightforward.
>
> Cheers,
>   - Andreas
>
>




More information about the Squeak-dev mailing list