Smalltalk uses inline parameters - similar to Objective C. In Java (and most other languages derived from Algol) this style is impossible if you are using more than 1 parameters. You must therefore use a convention to convert Smalltalk messages with inline parameters into Java methods.
The Cocoa Java bindings join the message names using underscores, and append the parameters in order: at_put(cell, data)
, foreColor_backColor_cell(color1, color2, cell)
You could also use a variant of camel case. This, however could cause name clashes (e.g. if there is a Smalltalk message atPut
, then you cannot shorten at:put:
to atPut
)
Aside from the conversion of inline-parameters, you could also run into the problem that the Smalltalk code uses reserved keywords. For example, for
is a perfectly valid message in Smalltalk, but you must not name a Java method for
. If you run into such cases, you must employ an escape strategy - e.g. by affixing an underscore so that the Java method becomes for_
.