Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!wuarchive!rex!uflorida!beach.cis.ufl.edu!yms From: yms@beach.cis.ufl.edu (Yuh-Ming Shyy) Newsgroups: comp.object Subject: Infinite Loop of Message Passing Message-ID: <26386@uflorida.cis.ufl.EDU> Date: 18 Jan 91 20:08:28 GMT Sender: news@uflorida.cis.ufl.EDU Reply-To: yms@beach.cis.ufl.edu () Distribution: usa Organization: UF CIS Department Lines: 35 Hi, I just came across an interesting scenario about an infinite loop of message passing. Any opinion will be highly appreciated. The problem happens when we model each method as an individual object, say, as an instance of a class called "METHOD". We can then define some methods for METHOD such as "eval", "compile", etc. Now, suppose class "STUDENT" defines a method called "eval_GPA", and we send a message "eval_GPA()" to a student "s1". What happens now is interesting: object "s1" checkes that "eval_GPA" is a method defined by "STUDENT", and so it sends a message "eval()" to the object "eval_GPA". Object "eval_GPA" will then checks and finds that "eval" is a method defined by class "METHOD", so it sends a message "eval()" to the object "eval". Object "eval" will then checks and finds that "eval" is a method defined by class "METHOD", so it sends a message "eval()" to itself recursively. The message "eval()" will then be sent back and forth between "eval" and "METHOD" and nothing can be actually evaluated. I am sure there must be something wrong with the above scenirio, but theoritically I cannot find any error (if we model everything as object as many people claimed). Thanks. Yuh-Ming