Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utcs!mnetor!seismo!rochester!ritcv!cci632!rb From: rb@cci632.UUCP Newsgroups: net.lang Subject: Re: Extensibility (Re: RRe: What's so good about FORTH? Message-ID: <210@cci632.UUCP> Date: Fri, 11-Jul-86 20:40:18 EDT Article-I.D.: cci632.210 Posted: Fri Jul 11 20:40:18 1986 Date-Received: Wed, 16-Jul-86 05:22:52 EDT References: <201@pyuxv.UUCP> <3700003@uiucdcsp> <132@vaxb.calgary.UUCP> <152@cci632.UUCP> <770@ucbcad.BERKELEY.EDU> Reply-To: rb@ccird1.UUCP (Rex Ballard) Organization: CCI, Rochester Development, Rochester, NY Lines: 37 Keywords: FORTH, threaded-code Summary: Which way(s) do you want to go? In article <770@ucbcad.BERKELEY.EDU> faustus@ucbcad.BERKELEY.EDU (Wayne A. Christopher) writes: >Perhaps this discussion is bothering some people, but I have another >question about forth for the gurus on the subject -- the major >advantage of C (as I see it) over Fortran, etc is the possibility of >defining structures and abstract types. Does forth have anything >comparable, or are there any forth paradigms that make this easy? Actually there are several variations for handling structures in forth. The simplest is to create words that access the members, and put the address of the structure (or the structure itself) on the stack. Another trick is to treat the structure as a stream and simply build the messages "on the fly". Forth tries very hard to avoid "stamp coupling" (hiding arguments in structures). Lee Forsly wrote a paper on using defining words to define defining words that is absolutely perverse. With slight changes however, it results in a very object oriented effect. I haven't played with it much, but it has interesting possibilities. The journal also proposes several cute extensions. >Also, >what sort of position does forth take in the spectrum with functional >programming on one end and object-oriented programming on the other? In "normal use", Forth is very much a functional programming style language. Neon is a Forth-like object-oriented language. OO can be added to forth quite easily (since operators are "free form", and can be re-defined). >It seems to me that (like C) forth doesn't really try to deal with this >problem... > > Wayne There are ways to implement object oriented design even in C. There is a big difference between object oriented design and object oriented languages. If you look at it sideways, UNIX device drivers are a cute example of object oriented design.