Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!wuarchive!udel!carroll From: carroll@udel.edu (Mark Carroll ) Newsgroups: comp.lang.forth Subject: Re: ... and zen there were objects. Message-ID: <27883@nigel.ee.udel.edu> Date: 19 Aug 90 18:34:32 GMT References: <11376@medusa.cs.purdue.edu> <1533.UUL1.3#5129@willett.pgh.pa.us> <11406@medusa.cs.purdue.edu> Sender: usenet@ee.udel.edu Organization: University of Delaware Lines: 62 Nntp-Posting-Host: dewey.udel.edu In article <11406@medusa.cs.purdue.edu> bouma@cs.purdue.EDU (William J. Bouma) writes: >In article <1533.UUL1.3#5129@willett.pgh.pa.us> dwp@willett.pgh.pa.us (Doug Philips) writes: >>In <11376@medusa.cs.purdue.edu> bouma@cs.purdue.EDU (William J. Bouma) writes: >> >>> 'traditional' language looks like. I would say the syntax with the >>> message at the end is really the most forth-like. The function usually >>> comes at the end in forth. The message is basically just an indirect >>> function call. >> >>I must disagree here. Your view is still the traditional NON OO view >>of functions with arguments. OO says just the opposite. OO says that it >>is the object which is interesting/important. The message is a thing which >>is passed to the object and which the object examines and does with as it >>sees fit. The message is just another parameter of sorts. Your style >>re-asserts the functional style in which the object is a parameter to the >>function. Not a common view of OO systems as I understand them. > > So wich of us is being more traditional? 8^) > > However some OO pusher wants to look at things the fact of the > implementation remains! The message is basically just an indirect > function call. I'll assume we agree on this. I've got to disagree here. It's true that on the implementation level, a "message pass" is a special kind of indirect function call. But if you think of it as being "just an indirect function call", then you've missed the entire point of object-oriented programming. If your programming style asserts the traditional functional style, considering methods to be nothing but functions, then you're going to end up seeing no benefit from the use of an object-oriented system. Object-orientation represents a very different way of approaching a problem. The benefits of object-oriented programming don't come from indirect function calls - those have been around for ages, and they aren't really that big a deal. The benefits comes from the difference in programming style. And that object-oriented programming style derives from the difference in approach. In an object-oriented programs, OBJECTS are active, FUNCTIONS are passive. An object-oriented automaton has a passive processor and an active store. Active objects are the entire point of object-orientation. >Then, getting back to > tradition, what is the traditional forth way of doing things? I would > say it is to take the easy way, the simplest is the best. So think of > implementing such a beast. The way I propose, the message can be a > normal forth word that simply does the indirection given the object > on the stack. The object can be just some data address plus a tag to > identify its "class". In traditional Forth, the active entity comes last. In a normal Forth program, the active entity is the word (function), so the name of the word (the function name) comes last. In an object-oriented Forth program, the active entity is the OBJECT. So the name of the object should come last. -- |Mark Craig Carroll: |"We the people want it straight for a change; |Soon-to-be Grad Student at| cos we the people are getting tired of your games; |University of Delaware | If you insult us with cheap propaganda; |carroll@udel.edu | We'll elect a precedent to a state of mind" -Fish