Is message passing taking place when calling a function with no input?
i.e. with: object.toString();
Am I passing a message to ‘object’?
This might vary between languages, but I’m specifically referring to Java.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
yes and no … message passing is a model … the only languages i personally know, that actually employ these semantics are Smalltalk and Objective-C … so yes, in the sense that
object.method()is as much message passing asobject.method(param_1,param_2,...param_n)… and no, becauseobject.method(param_1,param_2,...param_n)means:methodinobjectobjectas well asparam_1,...,param_nto itthis absolutely captures the semantics of message passing, but in the end, this is simple function invocation as you know it from procedural programming … the number of parameters neither changes the semantics of the model, nor the implementation … the parameter list for the actual call simply contains only
object…