Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #55862

Re: When to use !name vs. name! ?

Subject Re: When to use !name vs. name! ?
References <oa7clo$1pao$1@gioia.aioe.org> <oafbg5$o8g$1@dont-email.me>
Newsgroups comp.lang.forth
From "Elizabeth D. Rather" <erather@forth.com>
Organization FORTH, Inc.
Date 2017-03-16 21:34 -1000
Message-ID <rr6dnZECzYMUDFbFnZ2dnUU7-dnNnZ2d@supernews.com> (permalink)

Show all headers | View raw


On 3/16/17 2:46 PM, rickman wrote:
> On 3/13/2017 8:15 PM, HAA wrote:
>> This has come up before but without resolution i.e. when to use the form
>> !name  @name  vs.  name!  name@ ?
>>
>> The advantage of these is shortness.  Thinking Forth and FHP list both
>> forms but the descriptions are too vague or in some cases identical.
>> Scanning SwiftForth source files hasn't helped as there aren't enough
>> examples to suggest a pattern.
>>
>> One rationale is to use  !xxx  @xxx  when the operation doesn't take or
>> leave items on the data stack e.g.
>> @settings ( -- )  !settings ( -- )
>>
>> This is fine but such cases don't occur often enough to warrant the use.
>
> I guess I'm showing my lack of experience, but when do fetch and store
> words not use parameters on the stack?
>
> I thought there was already a convention that words which are
> functionally equivalent to name @ and name ! would be name@ and name!
> respectively.  No?
>
> What would you need @name for?

That's a carryover from the very early days, when Forth names were 
stored in the dictionary as count+1st 3 chars. In the era of extreme 
memory conservation (mostly the 70's; at NRAO Chuck controlled the 36' 
radio telescope and its dome and managed 4 concurrent terminals with 
operators in a 32Kb computer) that was necessary. So, we put the operant 
symbol (@ or !) first.

Cheers.
Elizabeth
-- 
Elizabeth R. Conklin
FORTH, Inc.
6080 Center Drive, Suite 600
Los Angeles, CA  90045
USA

Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

When to use  !name  vs.  name! ? "HAA" <someone@microsoft.com> - 2017-03-14 11:15 +1100
  Re: When to use  !name  vs.  name! ? hughaguilar96@gmail.com - 2017-03-13 18:27 -0700
    Re: When to use  !name  vs.  name! ? Mark Wills <markwills1970@gmail.com> - 2017-03-14 01:33 -0700
  Re: When to use  !name  vs.  name! ? Mark Wills <markwills1970@gmail.com> - 2017-03-14 01:30 -0700
  When to use  !name  vs.  name! ? NN <november.nihal@gmail.com> - 2017-03-14 02:56 -0700
    Re: When to use  !name  vs.  name! ? "HAA" <someone@microsoft.com> - 2017-03-16 08:59 +1100
      Re: When to use  !name  vs.  name! ? Mark Wills <markwills1970@gmail.com> - 2017-03-16 02:11 -0700
        Re: When to use  !name  vs.  name! ? "HAA" <someone@microsoft.com> - 2017-03-17 11:19 +1100
  Re: When to use !name vs. name! ? rickman <gnuarm@gmail.com> - 2017-03-16 20:46 -0400
    Re: When to use !name vs. name! ? "Elizabeth D. Rather" <erather@forth.com> - 2017-03-16 21:34 -1000
      Re: When to use !name vs. name! ? "HAA" <someone@microsoft.com> - 2017-03-18 09:49 +1100
        Re: When to use !name vs. name! ? "Elizabeth D. Rather" <erather@forth.com> - 2017-03-17 13:08 -1000
          Re: When to use !name vs. name! ? rickman <gnuarm@gmail.com> - 2017-03-17 19:35 -0400
            Re: When to use !name vs. name! ? Mark Wills <markwills1970@gmail.com> - 2017-03-18 00:51 -0700
            Re: When to use !name vs. name! ? "HAA" <someone@microsoft.com> - 2017-03-19 10:47 +1100
              Re: When to use !name vs. name! ? rickman <gnuarm@gmail.com> - 2017-03-18 22:18 -0400
                Re: When to use !name vs. name! ? "Elizabeth D. Rather" <erather@forth.com> - 2017-03-18 16:36 -1000
                Re: When to use !name vs. name! ? rickman <gnuarm@gmail.com> - 2017-03-18 23:53 -0400
                Re: When to use !name vs. name! ? "Elizabeth D. Rather" <erather@forth.com> - 2017-03-18 22:22 -1000
                Re: When to use !name vs. name! ? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-03-19 16:03 +0000
                Re: When to use !name vs. name! ? Alex <alex@rivadpm.com> - 2017-03-19 17:42 +0000
                Re: When to use !name vs. name! ? "Elizabeth D. Rather" <erather@forth.com> - 2017-03-19 13:10 -1000
                Re: When to use !name vs. name! ? albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2017-03-19 13:34 +0100
                Re: When to use !name vs. name! ? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-03-19 16:23 +0000
                Re: When to use !name vs. name! ? albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2017-03-19 20:47 +0100
                Re: When to use !name vs. name! ? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2017-03-20 03:47 -0500
                Re: When to use !name vs. name! ? "HAA" <someone@microsoft.com> - 2017-03-20 09:41 +1100
                Re: When to use !name vs. name! ? Coos Haak <htrofhc@gmail.com> - 2017-03-20 01:24 +0100
                Re: When to use !name vs. name! ? "HAA" <someone@microsoft.com> - 2017-03-21 12:10 +1100
                Re: When to use !name vs. name! ? hughaguilar96@gmail.com - 2017-03-20 18:45 -0700
                Re: When to use !name vs. name! ? Coos Haak <htrofhc@gmail.com> - 2017-03-21 14:58 +0100
                Re: When to use !name vs. name! ? "HAA" <someone@microsoft.com> - 2017-03-22 19:49 +1100
          Re: When to use !name vs. name! ? hughaguilar96@gmail.com - 2017-03-17 16:46 -0700
  Re: When to use  !name  vs.  name! ? Lars Brinkhoff <lars.spam@nocrew.org> - 2017-04-12 08:13 +0200

csiph-web