Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!agate!ucbvax!BRFAPESP.BITNET!UNBCIC From: UNBCIC@BRFAPESP.BITNET Newsgroups: comp.lang.forth Subject: What makes Forth Forth Message-ID: <9012092322.AA04013@ucbvax.Berkeley.EDU> Date: 8 Dec 90 15:47:00 GMT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: UNBCIC%BRFAPESP.BITNET@SCFVM.GSFC.NASA.GOV Organization: The Internet Lines: 37 > > I *DO* see an objection -- and I > >regard a strength of Forth as the ability to add new objects with > >first class status. This ability comes from the fact that the Forth > >programmer has access to the language at the level at which primary > >objects are introduced... > Well, what do you say to the C++/Ada/Smalltalk people then. They can > certainly do that too. Let's talk about C++ and Ada first. I know almost nothing about the ++ part of C++ and don't remember well Ada, but can you do: VOCABULARY COMPLEX COMPLEX DEFINITIONS : VARIABLE CREATE 2 CELLS ALLOT ; : + [ FORTH ] ROT + ROT ROT + SWAP ; : - [ FORTH ] ROT - ROT ROT - SWAP ; : SWAP 2SWAP ; : ! [ FORTH ] ROT OVER ! 2+ ! ; : @ [ FORTH ] DUP @ SWAP 2+ @ ; : . [ FORTH ] . ?DUP IF 0> IF ." +" THEN . ." i" THEN ; FORTH DEFINITIONS COMPLEX VARIABLE A VARIABLE B VARIABLE C VARIABLE D 2 3 A ! 5 1 B ! A @ B @ + C ! A @ B @ SWAP - D ! C @ . CR D @ . in Ada or C++? You can do this in Smaltalk, but there are other things you can't redefine in Smaltalk: blocks and arrays delimiters, sintax... In Forth you can redefine anything. (8-DCS)