Path: csiph.com!aioe.org!.POSTED!not-for-mail From: Rod Pemberton Newsgroups: comp.lang.forth Subject: Re: NAME! and NAME@ versus !NAME and @NAME Date: Thu, 11 Feb 2016 05:02:07 -0500 Organization: Aioe.org NNTP Server Lines: 46 Message-ID: <20160211050207.09f4d18c@_> References: <8660xvzkm2.fsf@molnjunk.nocrew.org> NNTP-Posting-Host: n4wpt9zq8xR26Ttf9mo2BA.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: Claws Mail 3.13.1 (GTK+ 2.24.10; x86_64-unknown-linux-gnu) Xref: csiph.com comp.lang.forth:45438 On Thu, 11 Feb 2016 10:01:25 +0100 Lars Brinkhoff wrote: > Leo Brodie's Forth style guide says: >=20 > save value of (to stack) @name > restore value of !name > store into name! > fetch from name@ >=20 > I don't understand when it's appropriate to use @name or !name, and > when to use name@ or name!. >=20 > My research so far: The Standard use the latter a lot: C!, 2! R@, F!, > DEFER@, etc. But the former seems to be rare. I found !CSP and !BITS > in some traditional Forths. Machine Forth use A!/A@ to access the > contents of the A register, and !A/@A to access memory. >=20 > Any insights? Leo Brodie's "Thinking Forth" pg 287 Meaning Form Example ... save value of @name @CURSOR restore value of !name !CURSOR store into name! SECONDS! fetch from name@ INDEX@ ... =46rom that, my guess is that if the source is the data stack and destination is a variable, then the @ and ! come after and vice-versa. I.e., @name and !name are expected to be paired operations and so are name! and name@. a) variable -> data stack -> variable b) data stack -> variable -> data stack Of course, as you can see they are equivalent. It's just a matter of the the expected source. Rod Pemberton