Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!wuarchive!udel!rochester!pt.cs.cmu.edu!dsl.pitt.edu!pitt!willett!dwp From: dwp@willett.pgh.pa.us (Doug Philips) Newsgroups: comp.lang.forth Subject: Re: Data Structures Message-ID: <1801.UUL1.3#5129@willett.pgh.pa.us> Date: 4 Oct 90 00:35:44 GMT References: <978@shakti.ncst.ernet.in> Organization: String, Scotch tape, and Paperclips. (in Pgh, PA) Lines: 26 In <978@shakti.ncst.ernet.in>, shri@ncst.ernet.in (H.Shrikumar) writes: > Also, another thing I am trying out in myForth is that all operators > which take a pointer, should return a pointer. > > The idea is ... say a word that takes a string and replaces "$1" by > "gus" ("fun$1prat" becomes "fungusprat") would take a pointer to the > string, do its job and return a pointer to the new string. > > The retuned pointer may or may not be the same, the program must not > make assumptions about it (sorry hackers :-). > > This is not too difficult to implement, only a little inefficient, > and gives a clean semantics. (IMHO, worth it.) The only objection I see to that is that it makes data structures that share data by pointer a pain, because anytime something happens to an object, there can be arbitrary many pointers that need to be updated. For that reason, and others, most systems without Virtual Memory (where an address can be "mapped" to any other arbitrary address at will and at run-time) go to another level of indirection, often called 'handles'. I can see how what you are proposing could have handles nicely layered on top of it. -Doug --- Preferred: dwp@willett.pgh.pa.us Ok: {pitt,sei,uunet}!willett!dwp