@ as a method name

Doug Way dway at riskmetrics.com
Sat Feb 8 01:09:53 UTC 2003


(Filling in a few details)

Bob Arning wrote:
> 
> On Fri, 07 Feb 2003 16:41:52 -0800 Derek Brans <brans at nerdonawire.com> wrote:
> >Can @ be used as a method with one argument?
> >
> >self @ 2
> 
> Yes.

Also, the "@" method already exists in the class Number... it's used to make
Point objects.

> >What about as part of a method name:
> >self @size: 10
> 
> No.

Special characters such as "@" can only be used in "binary" selectors (method
names), which always have one argument, and cannot include any alphanumeric
characters.  Examples: +, -, //, etc.

"Keyword" selectors such as "size:" can contain only alphanumeric characters.

- Doug Way



More information about the Squeak-dev mailing list