Home > Archive > Smalltalk > December 2007 > FINALLY: Another language adopts Smalltalk's keyword -syntax
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
FINALLY: Another language adopts Smalltalk's keyword -syntax
|
|
|
| Well, not literally, but similarly.
In Groovy 1.5 you can write code like:
monster.move left: 3.meters, at: 5.mph
In Smalltalk the above would read:
monster moveLeft: 3 meters at: 5 mph
I think: Again, another try at striving
towards Smalltalk's eloquence, yet still
not quite getting there.
More about Groovy 1.5 is at
http://www.infoq.com/articles/groov...5
84E8E04
-Panu Viljamaa
| |
| S Perryman 2007-12-16, 4:32 am |
| Panu wrote:
> Well, not literally, but similarly.
> In Groovy 1.5 you can write code like:
> monster.move left: 3.meters, at: 5.mph
> In Smalltalk the above would read:
> monster moveLeft: 3 meters at: 5 mph
> I think: Again, another try at striving
> towards Smalltalk's eloquence, yet still
> not quite getting there.
And what if I want to write :
monster at: 5 mph moveLeft: 3 meters
Cannot do that in Smalltalk. Hmm.
A better title might be :
FINALLY: Another language on the road to Lisp/CLOS keyword parameter
schemes ...
Regards,
Steven Perryman
| |
|
| S Perryman wrote:
> And what if I want to write :
>
> monster at: 5 mph moveLeft: 3 meters
>
> Cannot do that in Smalltalk. Hmm.
Hmm? The above seems like valid Smalltalk to me.
Just like:
myDictionary at: 5 someMsg put: 3 someOtherMsg
I haven't done Lisp in years, but isn't it also the
case that you would need to add some parenthesis
to make your example an executable snippet of Lisp?
-Panu Viljamaa
| |
| Stefan Schmiedl 2007-12-16, 8:15 am |
| On Sun, 16 Dec 2007 06:12:58 -0500
Panu <panu@nospam.com> wrote:
> S Perryman wrote:
>
> Hmm? The above seems like valid Smalltalk to me.
> Just like:
>
> myDictionary at: 5 someMsg put: 3 someOtherMsg
>
>
> I haven't done Lisp in years, but isn't it also the
> case that you would need to add some parenthesis
> to make your example an executable snippet of Lisp?
>
> -Panu Viljamaa
>
$ sbcl
....
* (defun monster (&key at moveLeft) (list at moveLeft))
MONSTER
* (monster :at 5 :moveLeft 10)
(5 10)
* (monster :moveLeft 10 :at 5)
(5 10)
One of Lisp's advantages is that the sequence of keyword arguments does
not matter. And you could define default values so that you would not
have to provide all arguments all the time. And this works with a single
function definition, whereas in Smalltalk I'd have to define multiple
methods for the different ways of calling it.
s.
| |
| Daniel T. 2007-12-16, 7:17 pm |
| Stefan Schmiedl <s@xss.de> wrote:
> One of Lisp's advantages is that the sequence of keyword arguments does
> not matter.
You are assuming that is an advantage...
monster moveAt: 5 mph left: 3 meters.
monster moveLeft: 3 meters at: 5 mph.
It seems to me that allowing both lines above obfuscates without adding
anything useful.
| |
| Stefan Schmiedl 2007-12-17, 4:35 am |
| On Sun, 16 Dec 2007 13:42:46 -0500
"Daniel T." <daniel_t@earthlink.net> wrote:
> Stefan Schmiedl <s@xss.de> wrote:
>
>
> You are assuming that is an advantage...
I *know* that it has been an advantage for me since I had less to
remember: only the names instead of names+sequence.
s.
| |
| Daniel T. 2007-12-17, 7:22 pm |
| Stefan Schmiedl <s@xss.de> wrote:
> "Daniel T." <daniel_t@earthlink.net> wrote:
>
> I *know* that it has been an advantage for me since I had less to
> remember: only the names instead of names+sequence.
You anecdotal evidence is hardly convincing.
| |
| S Perryman 2007-12-17, 7:22 pm |
| "Daniel T." <daniel_t@earthlink.net> wrote in message
news:daniel_t-439404.10541217122007@earthlink.vsrv-sjc.supernews.net...
> Stefan Schmiedl <s@xss.de> wrote:
SS> One of Lisp's advantages is that the sequence of SS>keyword arguments
does not matter.
DT> You are assuming that is an advantage...
[color=darkred]
> You anecdotal evidence is hardly convincing.
Anecdotal +1 ( 1. same reasons as Stefan. 2. have programmed
in industry in both CLOS and Smalltalk) .
Regards,
Steven Perryman
| |
| Cesar Rabak 2007-12-17, 7:22 pm |
| S Perryman escreveu:
> "Daniel T." <daniel_t@earthlink.net> wrote in message
> news:daniel_t-439404.10541217122007@earthlink.vsrv-sjc.supernews.net...
>
>
> SS> One of Lisp's advantages is that the sequence of SS>keyword arguments
> does not matter.
>
> DT> You are assuming that is an advantage...
>
>
>
> Anecdotal +1 ( 1. same reasons as Stefan. 2. have programmed
> in industry in both CLOS and Smalltalk) .
>
Since you're adding 100% to this crowd, let's understand exactly what
you're saying:
In Smalltalk:
monster moveLeft: 3 meters at: 5 mph.
In CLOS:
(monster :moveLeft 10 :at 5)
This CLOS variant:
(monster :at 5 :moveLeft 10)
isn't it a way of writting in Smalltalk again:
monster at: 5 mph; moveLeft: 3 meters.
?
| |
| Stefan Schmiedl 2007-12-17, 7:22 pm |
| Hi Cesar,
On Mon, 17 Dec 2007 18:19:31 -0300
Cesar Rabak <csrabak@yahoo.com.br> wrote:
> S Perryman escreveu:
It does not have to *convince* anybody, I'm only pointing out that
I'm not *assuming*, but instead *know*.
[color=darkred]
> In Smalltalk:
> monster moveLeft: 3 meters at: 5 mph.
>
> In CLOS:
>
> (monster :moveLeft 10 :at 5)
>
> This CLOS variant:
>
> (monster :at 5 :moveLeft 10)
>
> isn't it a way of writting in Smalltalk again:
> monster at: 5 mph; moveLeft: 3 meters.
Yes. Cascading goes a long way towards avoiding combinatorial
explosions. How does it fare with providing default arguments?
(defun move-monster-left (monster &key (distance 10) (speed 5))
(list distance speed))
can be called as
(move-monster-left m) -> (10 5)
(move-monster-left m :distance 20) -> (20 5)
(move-monster-left m :speed 7) -> (10 7)
(move-monster-left m :speed 7 :distance 20) -> (20 7)
How would this translate to idiomatic Smalltalk?
Dang... switched into Lisp mode now, can't think smalltalky anymore.
s.
| |
| Cesar Rabak 2007-12-17, 7:22 pm |
| Stefan Schmiedl escreveu:
> Hi Cesar,
Hi Stefan,
>
> On Mon, 17 Dec 2007 18:19:31 -0300
> Cesar Rabak <csrabak@yahoo.com.br> wrote:
>
>
> It does not have to *convince* anybody, I'm only pointing out that
> I'm not *assuming*, but instead *know*.
Although I left that for context, this is not my post... I'll leave to
the author to discuss that!
>
>
> Yes. Cascading goes a long way towards avoiding combinatorial
> explosions. How does it fare with providing default arguments?
>
> (defun move-monster-left (monster &key (distance 10) (speed 5))
> (list distance speed))
>
> can be called as
>
> (move-monster-left m) -> (10 5)
> (move-monster-left m :distance 20) -> (20 5)
> (move-monster-left m :speed 7) -> (10 7)
> (move-monster-left m :speed 7 :distance 20) -> (20 7)
>
> How would this translate to idiomatic Smalltalk?
>
It is easy. .
> Dang... switched into Lisp mode now, can't think smalltalky anymore.
>
and I'll (try to) help you to switch back:
In Smalltalk you can do two ways:
1) At the invocation of the new method initialize all your state
variables to default values (using your data as example):
Monster>>new
super new.
distance := 10.
speed := 5.
"etc."
or
2) Use lazy initialization (better), new method as needed:
Monster>>distance
distance isNil
ifTrue:[distance := 10]
^distance
Monster>>speed
speed isNil
ifTrue:[speed := 5]
^speed
Regards,
--
Cesar Rabak
| |
| S Perryman 2007-12-18, 4:30 am |
| Cesar Rabak wrote:
> S Perryman escreveu:
DT> You anecdotal evidence is hardly convincing.
[color=darkred]
> Since you're adding 100% to this crowd, let's understand exactly what
> you're saying:
> In Smalltalk:
> monster moveLeft: 3 meters at: 5 mph.
> In CLOS:
> (monster :moveLeft 10 :at 5)
> This CLOS variant:
> (monster :at 5 :moveLeft 10)
> isn't it a way of writting in Smalltalk again:
> monster at: 5 mph; moveLeft: 3 meters.
I have type Monster.
I recall it has an op to move left a certain distance at a certain
speed. I recall that the keywords for the parameters are "moveLeft"
and "at" . I cannot recall the order in which the parameters are
given.
So in Lisp I can write any of the following :
(monster :moveLeft 10 :at 5) ;; #1
(monster :at 5 :moveLeft 10) ;; #2
Both will have the same effect (invoke the same op) .
Now in Smalltalk, I have the op moveLeft: D at: Speed.
Providing ST equivalents of #1 and #2, what are the
effects ??
#1 is ok. #2 causes a software crash (no such operation) .
So in Lisp, knowing the keywords is sufficient.
In Smalltalk, knowing the keywords *and their ordinal position*
is necessary.
For a operation with n keyword parameters, Lisp implicitly
provides n! (nPn) op signatures bound to one implementation.
To achieve the equivalent in Smalltalk would appear to require
n! different operations (signatures + impls) to be explicitly
provided.
Regards,
Steven Perryman
| |
| Daniel T. 2007-12-18, 8:16 am |
| In article <fk82ud$m40$1@aioe.org>, S Perryman <q@q.com> wrote:
> Cesar Rabak wrote:
>
>
> DT> You anecdotal evidence is hardly convincing.
>
>
>
>
>
>
>
>
>
> I have type Monster.
> I recall it has an op to move left a certain distance at a certain
> speed. I recall that the keywords for the parameters are "moveLeft"
> and "at" . I cannot recall the order in which the parameters are
> given.
You obviously have no problems remembering ordering requirements in
languages or you couldn't write understandable English.
> So in Lisp I can write any of the following :
>
> (monster :moveLeft 10 :at 5) ;; #1
> (monster :at 5 :moveLeft 10) ;; #2
(You seemed to remember the positional requirements of needing 'monster'
before either parameter, of needing parens around all the arguments, of
needing the numbers after their keywords of needing the comment on the
end of the line rather than somewhere else in the line... You have no
problem with all these positional requirements...)
Which makes more sense linguistically? Telling a monster to move left 10
meters at 5 mph, or telling him to "at 5 mph move left 10 meters." You
obviously understand English so quit playing this game.
> For a operation with n keyword parameters, Lisp implicitly
> provides n! (nPn) op signatures bound to one implementation.
More choices aren't always better.
| |
| Steven Kelly 2007-12-18, 8:16 am |
| "S Perryman" <q@q.com> wrote in message news:fk82ud$m40$1@aioe.org...
> For a operation with n keyword parameters, Lisp implicitly
> provides n! (nPn) op signatures bound to one implementation.
> To achieve the equivalent in Smalltalk would appear to require
> n! different operations (signatures + impls) to be explicitly
> provided.
Although a similar effect can be achieved in Smalltalk with cascading
as Cesar pointed out, it only works if each keyword is separately a
setter of an instance variable - rarely the case.
What does Lisp do if there are several keywords with the same name?
E.g. Array>>with:with: creates an array with the first and second
arguments in the corresponding slots. Does Lisp disallow using the
same keyword twice, or impose an ordering on just these keywords, or
lose the ordering? In my Smalltalk image, about 2.5% of multi-keyword
methods use the same keyword more than once. A problem in that area
would be more significant than the gain of being able to call a method
without remembering the ordering of its parameters -- although that's
maybe just my poor memory, which means I need to look the method name
up anyway.
All the best,
Steve
--
Steven Kelly, CTO, MetaCase,
http://www.metacase.com/blogs/stevek/blogView[color=darkred]
<
Bill Gates on Domain-Specific Modeling,
www.adtmag.com/article.asp?id=9166
| |
| Stefan Schmiedl 2007-12-18, 8:16 am |
| On Tue, 18 Dec 2007 11:29:00 GMT
"Steven Kelly" <stevek@metacase.com> wrote:
> What does Lisp do if there are several keywords with the same name?
In that case I've used lists as container for a single keyword.
Tends to come naturally in Lisp.
> E.g. Array>>with:with: creates an array with the first and second
> arguments in the corresponding slots. Does Lisp disallow using the
> same keyword twice, or impose an ordering on just these keywords, or
> lose the ordering?
keywords are required to be unique (:whatever is a symbol similar to
#whatever in Smalltalk) and unordered.
> In my Smalltalk image, about 2.5% of multi-keyword
> methods use the same keyword more than once. A problem in that area
> would be more significant than the gain of being able to call a method
> without remembering the ordering of its parameters -- although that's
> maybe just my poor memory, which means I need to look the method name
> up anyway.
oooohh... that's what auto-completion is for :-)
s.
| |
| Stefan Schmiedl 2007-12-18, 8:16 am |
| On Tue, 18 Dec 2007 06:22:31 -0500
"Daniel T." <daniel_t@earthlink.net> wrote:
> In article <fk82ud$m40$1@aioe.org>, S Perryman <q@q.com> wrote:
>
> ....
>
> More choices aren't always better.
Your anecdotal evidence is hardly convincing.
Oh wait, you didn't even provide anecdotal evidence, you just issued
a quite worthless general statement.
Oh well...
s.
| |
| S Perryman 2007-12-18, 8:16 am |
| Stefan Schmiedl wrote:
> On Tue, 18 Dec 2007 06:22:31 -0500
> "Daniel T." <daniel_t@earthlink.net> wrote:
SP>For a operation with n keyword parameters, Lisp implicitly
SP>provides n! (nPn) op signatures bound to one implementation.
[color=darkred]
> Your anecdotal evidence is hardly convincing.
> Oh wait, you didn't even provide anecdotal evidence, you just issued
> a quite worthless general statement.
> Oh well...
Indeed. :-)
Regards,
Steven Perryman
| |
| Daniel T. 2007-12-18, 8:16 am |
| Stefan Schmiedl <s@xss.de> wrote:
> "Daniel T." <daniel_t@earthlink.net> wrote:
[Here, Stefan snips the meat of my post so he can make some lame attempt
at being witty]
[color=darkred]
>
> Your anecdotal evidence is hardly convincing.
>
> Oh wait, you didn't even provide anecdotal evidence, you just issued
> a quite worthless general statement.
I provided better than anecdotal evidence, I showed, using evidence,
that Perryman is quite capable of remembering positional rules in
languages.
That's fine though, keep up your language war if you must. "My favorite
language does X better than yours", no matter if the X in question is of
no import.
| |
| S Perryman 2007-12-18, 8:16 am |
| Daniel T. wrote:
> Stefan Schmiedl <s@xss.de> wrote:
[color=darkred]
[color=darkred]
> I provided better than anecdotal evidence, I showed, using evidence,
> that Perryman is quite capable of remembering positional rules in
> languages.
Actually, you did no such thing.
1. Because the debate is not about "rules" (the keyword/value pair for
parameter 1 must appear before the keyword/value pair for parameter 2
etc) . It is about having to remember the *order in which the pairs
were defined* .
Lisp and similar remove this particular burden from me.
2. So you are actually arguing about something completely different.
> That's fine though, keep up your language war if you must. "My favorite
> language does X better than yours", no matter if the X in question is of
> no import.
Actually, as I started this particular sub-thread, it is quite relevant.
The proclamation by the OP (as stated in the subject line) is, as I have
sshown, is not really anything to shout about.
Regards,
Steven Perryman
| |
| Dmitry A. Kazakov 2007-12-18, 8:16 am |
| On Tue, 18 Dec 2007 06:22:31 -0500, Daniel T. wrote:
> (You seemed to remember the positional requirements of needing 'monster'
> before either parameter, of needing parens around all the arguments, of
> needing the numbers after their keywords of needing the comment on the
> end of the line rather than somewhere else in the line... You have no
> problem with all these positional requirements...)
>
> Which makes more sense linguistically? Telling a monster to move left 10
> meters at 5 mph, or telling him to "at 5 mph move left 10 meters." You
> obviously understand English so quit playing this game.
Linguistically there are lots of inflected languages, where objects,
subjects and verbs may appear in any order. English is rather an exception.
And even English isn't purely positional, so it has prepositions like "at"
used before the speed, inflected ordinals etc.
P.S. It is a proven bad idea to mimic natural languages when designing a
machine/technical/scientific one.
P.P.S. You guys better stop mixing miles and meters, at least not in the
same sentence. That's "monstrous"! (:-))
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
| |
| Stefan Schmiedl 2007-12-18, 7:21 pm |
| On Tue, 18 Dec 2007 07:28:10 -0500
"Daniel T." <daniel_t@earthlink.net> wrote:
>
> I provided better than anecdotal evidence, I showed, using evidence,
> that Perryman is quite capable of remembering positional rules in
> languages.
You showed, using Perryman (an individual) is capable of remembering
positional rules in *one* language, English, which might even be his
mothertongue. If that's not anecdotal, I don't know what is.
It's totally different, if you from a different language come, where
other positional conventions in use are. In that case, maintaining the
"native" ordering takes actual work.
> That's fine though, keep up your language war if you must. "My favorite
> language does X better than yours", no matter if the X in question is of
> no import.
Where have I said "better" in my posts? I was very careful not to,
exactly to avoid being accused for language-warring when I'm not.
But I give you a .2 rating on my personal Naggum scale for the effort.
s.
| |
|
| Daniel T. wrote:
> Which makes more sense linguistically? Telling a monster to move left 10
> meters at 5 mph, or telling him to "at 5 mph move left 10 meters." ...
Like in English, Smalltalk allows you to give *different
semantics* for different orderings of the arguments. This
is a strength, not a weakness.
Your point is good: If the order didn't matter, it probably
wouldn't matter in natural languages either, which have
evolved over millions of years.
Consider "I love you" vs. "You love me". Would it be better
if these sentences had the same meaning? Probably not.
The ability to attach different meaning to different orderings
of words means we can express more meanings with the same
set of elementary meaning-components (= words), and therefore
we can also attach more different meanings to a code-excerpt
of the same length.
The Lisp scheme of 'order' doesn't matter therefore seems to
write more code to express the same set of meanings. The
semantic 'concentration' of Smalltalk is higher than Lisp's in
this issue.
As to the default arguments, you can always provide a default
argument by writing a second version of the method, with
one less keyword. I like Lisp's ability to define defaults
for arguments, but the Smalltalk way is /not much worse/
in this respect. Why? A method is supposed to be a reusable
piece of code. It needs to be written only once, whereas
calls to it will be written many times. So it matters more
that we can make code shorter in places where we call a method,
than where we define the method.
A method is supposed to be an encapsulated black box. As long
as we know its 'contract' it doesn't matter so much whether
we even have its source-code or not. From the point of view
of the client-programmer it means more how readable the client-
code looks.
This brings back the old argument of Perl's "there's more
than one way to express it". Personally I think that to
bad. If there are multiple ways of expressing exactly the
same thing, clearly the most succinct expression is the most
economical.
Being able to reorder the keyword arguments means there
are multiple ways of *same* length to express the same
semantics. One downside of this may be that it becomes
harder to recognize the pattern, when more than one
expression has exactly the same meaning.
What if there were a thousand ways ways to express "I'm
going to sleep now"? Would it make such a language more
difficult to learn, and therefore also more prone to
errors? Probably so.
Combination of elementary INDEPENDENT operations to create
different meanings by combination is a different issue.
Smalltalk 'cascades' do it well. Is there something
like cascades in Lisp?
Thanks for the discussion. I find it interesting.
-Panu Viljamaa
| |
|
| Steven Kelly wrote:
> What does Lisp do if there are several keywords with the same name?
> E.g. Array>>with:with: creates an array with the first and second
> arguments in the corresponding slots.
A very good point. I'm not really trying to argue against
Lisp here, but the difference between orderless and ordered
keyword arguments is fascinating.
In the most basic sense the question is: "Is it beneficial
to attach different meanings to different orderings of
words?" ALthough I can't give a mathematical proof for it,
I believe the existing natural - and even the programming -
languages prove this to be the case. Is there *any* programming
language in which the order of terminals doesn't matter?
If there isn't we should ask, why not? There must be something
good about being able to attach different meanings to different
orderings of words.
-Panu VIljamaa
| |
| Dmitry A. Kazakov 2007-12-22, 4:25 am |
| On Fri, 21 Dec 2007 23:02:00 -0500, Panu wrote:
> In the most basic sense the question is: "Is it beneficial
> to attach different meanings to different orderings of
> words?"
The issue boils down to the size of the alphabet. When you use an infinite
alphabet you can express anything using just one symbol. When you want to
reduce the alphabet size then the ultimate answer is just one symbol
repeated n times, when n encodes meaning. In either case you don't need
ordering (or grammar).
> ALthough I can't give a mathematical proof for it,
> I believe the existing natural - and even the programming -
> languages prove this to be the case. Is there *any* programming
> language in which the order of terminals doesn't matter?
They are all around. Ordering expressing semantics appears in the languages
which lexical nature already has some enforced order, such as spoken
languages, or ones written in some sequential order. This is a limitation,
it is not an advantage. Spoken languages are sequential and half-duplex
because of how our hearing and speaking work.
On the contrary, visual languages typically lack order, because our vision
is spatial, consider Simulink and UML as examples.
Though in mathematics, numerals are denoted in positional system, it would
be silly to claim that the language of mathematics is positional. It often
uses commutative operations and ones spatially organized.
> There must be something
> good about being able to attach different meanings to different
> orderings of words.
Compression. English (positional inflection) sentences are usually shorter
than Russian (lacks order in most cases, uses declension and conjugation
instead) equivalents. A di vantage is ambiguity: A B C is it A (B C) or
(A B) C? In English it is resolved by occasional mixing the positional
system with prepositions: C of A B.
But actually nobody knows, because languages greatly vary in that respect.
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
| |
| Rainer Joswig 2007-12-22, 7:16 pm |
| In article <fk6lb6$sc4$1@aioe.org>, Cesar Rabak <csrabak@yahoo.com.br>
wrote:
> S Perryman escreveu:
> Since you're adding 100% to this crowd, let's understand exactly what
> you're saying:
>
> In Smalltalk:
> monster moveLeft: 3 meters at: 5 mph.
>
> In CLOS:
>
> (monster :moveLeft 10 :at 5)
a) That's Common Lisp. Not CLOS. CLOS is just a part of Common Lisp.
The programming language is Common Lisp.
b) it would usually be:
(move monster :direction :left :at 5)
Since in Lisp the 'verb' comes first and the subject
'monster' is a parameter. Lisp is oriented towards
functions (= verb) , not objects (= subject).
The usual pattern is:
(verb subjects... parameters...)
Like
(draw line-1 canvas-1 :transparency 0.5)
The differences to Smalltalk are:
a) the verb comes first
b) there is not one distinguished argument. Usually
the objects are listed as positional arguments.
In CLOS (now really CLOS), the dispatching
is done over all objects.
c) the parameters are added as keyword parameters.
Each parameters is optional and doesn't have
a fixed position (other than being added at the end).
Whereas in Smalltalk:
a) the object comes first
b) the message is a sequence of keywords and parameters.
c) the message's keywords have fixed positions
>
> This CLOS variant:
>
> (monster :at 5 :moveLeft 10)
>
> isn't it a way of writting in Smalltalk again:
> monster at: 5 mph; moveLeft: 3 meters.
>
> ?
--
http://lispm.dyndns.org/
| |
| Doug Hoffman 2007-12-26, 8:12 am |
| Daniel T. wrote:
> Stefan Schmiedl <s@xss.de> wrote:
>
>
> You are assuming that is an advantage...
>
> monster moveAt: 5 mph left: 3 meters.
>
> monster moveLeft: 3 meters at: 5 mph.
>
> It seems to me that allowing both lines above obfuscates without adding
> anything useful.
Indeed.
In another language (PowerMops) we get along fine with something like
the following.
3 5 moveLeft: monster
or, if visual cues are desired we can insert comments
3 ( meters) 5 ( mph) moveLeft: monster
or if unit conversion/declaration is required then we would do it as follows
3 meters 5 mph moveLeft: monster
Actually we have no concept of "keywords" in a message send. There can
only be a single word message (in this case moveLeft:) with as many
parameters as one wishes. The number and order of parameters is fixed
and must precede the message. All message names must end with a
colon(:). The object normally immediately follows the message. We have
an easy to use look-up browser to remind of parameter type and order.
Regards,
-Doug Hoffman Longtime lurker and admirer of Smalltalk
http://sourceforge.net/projects/powermops/ (Macintosh only)
|
|
|
|
|