[squeak-dev] Re: Code formatting patterns

Bob Arning arning315 at comcast.net
Wed Oct 9 14:58:27 UTC 2013


I've added a couple of options for emphasizing comments.

Cheers,
Bob

On 10/8/13 8:47 PM, Jecel Assumpcao Jr. wrote:
> Bob Arning wrote:
>
>> Not sure you need special magic key. Comments know where they are
>> in the text, but could be displayed just about anywhere. Some experiments
>> underway at:
>>
>> http://69.251.218.6:9116/split
> That looks pretty good!
>
> For a very compact Smalltalk that I designed, I didn't add comments to
> the language itself but rather had this method for Points:
>
> comment: explanation on: expression
>    ^ expression
>
> which allowed code like:
>
> a := b + (15 at 15 comment: 'this is scaled for 32 bit words' on: c*4)
>
> This would work with a very simple text editor and would give the
> correct result with a very dumb compiler. But you could have a smarter
> compiler notice that the receiver is a constant object and optimize the
> message send away. And a fancier editor could show just:
>
> a := b + (c*4)
>
> with the expression in parenthesis having a slightly different
> background color, so when you passed the cursor over it the text 'this
> is scaled for 32 bit words' would appear at the indicated offset (15 at 15)
> from the bottom left of the left parenthesis.
>
> Two advantages of this scheme were that the comment could be any object
> at all, and not just Strings, and that the comment refers to a whole
> code fragment and not just to a single point in the code text.
>
> -- Jecel
>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20131009/057785f2/attachment.htm


More information about the Squeak-dev mailing list