Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Julian Fondren Newsgroups: comp.lang.forth Subject: Re: multi-threading in Forth? Date: Sun, 07 Aug 2011 01:13:33 -0500 Organization: A noiseless patient Spider Lines: 30 Message-ID: <86mxfl4ulu.fsf@gmail.com> References: <07679799958436@frunobulax.edu> <4e3aa6ce.690183008@192.168.0.50> <8662mb5rw8.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx04.eternal-september.org; posting-host="cO8zBIpB9LiP7q+vFZIJrA"; logging-data="10807"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/sJCUKKjhDsBoJRq6gFfXDzKY4j+2myao=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (windows-nt) Cancel-Lock: sha1:BSF+9iTvqfIzUZDfqJPs0F3O8EI= sha1:D1Aq135IWBzzyhFR3qy8AfIUO6Y= Xref: x330-a1.tempe.blueboxinc.net comp.lang.forth:4631 Spam@ControlQ.com writes: > I would suggest that you implement a generic stack, and re-write >R R> > and R@ in terms of that code. You could then use the faux "return > stack" in the manner you expect, and with impunity ... or simply drop > the return stack use and replace it with your own stack implementation > ... and that would be completely portable. If this were possible, then I could use >R R> R@ with impunity _right now_, without going to the trouble of reimplementing , as I'd know that I could write a straightforward compatibility layer for a future system. I would have the attitude towards return-address manipulation that I have toward PLACE APPEND ++ SKIP SCAN and others. But this isn't the case. I can't roll my own return addresses just by rolling my own stack. \ documentation synonyms. : >ra ( -- r-addr ) postpone >r ; immediate : ra> ( r-addr -- ) postpone r> ; immediate : ra@ ( -- r-addr ) psotpone r@ ; immediate Look at these words: : call ( r-addr -- ) >ra ; : cont ( -- r-addr ) ra@ magic-number + ; : x ( -- r-addr ) cont ahead ." It's like an XT." then ; x call