I need some examples of sending parameters in smalltalk
How do I send parameters in smalltalk:
- Pass-by-Value
- Pass-by-Result
- P开发者_开发百科ass-by-Value-result
- Pass-by-References
- Pass-by-Name
You can safely assume that all parameters in smalltalk are passed by reference.
There's only one exception for immediate object (smallintegers) which are passed by value, but its an implementation detail (different implementations could have different kinds of immediate object classes).
AFAK, Smallscript Smalltalk uses pass-by-value as default unless you use the & sign for pass by reference just like C++, there is more information on this here.
But traditionally Smalltalk uses pass by reference as mentioned here and here.
精彩评论