[Pharo-project] Noobs perspective on pasting example code

Stéphane Ducasse stephane.ducasse at inria.fr
Thu Jan 26 04:56:31 EST 2012

On Jan 26, 2012, at 8:15 AM, Ben Coman wrote:

> Just a passing thought.... 
> It is common convention for example methods to be presented in text using '>>' preceded by the class.  This is obviously needed to define the class/method relationship outside the image, but the whole example cannot be pasted directly into System Browser as the '>>' is not part of the Smalltalk syntax for defining methods.  
> For those new to Pharo going through tutorials, copy/pasting the whole of the presented code eg [1] returns only the error  "Nothing more expected" which is a bit cryptic to noobs who expect to follow the example verbatim.  Once past understanding this, it continues (for me) to be a minor annoyance to have to select only the text following the '>>'.

would be nice!

> I wonder whether it would be beneficial for the compiler to handle  '>>'  at the start of a method definition.  The System Browser would then jump to the created method.  As well as beneficial to those experiencing Pharo for the first time, this might be useful as a general shortcut such that when browsing one class you can define a method for another class without first having to browse to that class.

Ideally I would like to have also the support for coral syntax :)

> cheers, Ben
> [1]
> BExp>>testBlock: aBlock
> | t |
> t := nil.
> aBlock value

More information about the Pharo-dev mailing list