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


Groups > comp.lang.forth > #52632

Re: Any practical use for Atoms?

From Rod Pemberton <NeedNotReplyHere@xrsevnneqk.cem>
Newsgroups comp.lang.forth
Subject Re: Any practical use for Atoms?
Date 2016-11-14 16:39 -0500
Organization Aioe.org NNTP Server
Message-ID <20161114163914.102569f9@_> (permalink)
References <12a2ec20-009c-4e5b-92b5-e48b0da40aa0@googlegroups.com>

Show all headers | View raw


On Mon, 14 Nov 2016 08:42:57 -0800 (PST)
trans <transfire@gmail.com> wrote:

> I know this is a bit off the wall, but I've been learning Erlang this
> month. And Erlang has "atoms" which are words that just stand for
> themselves. They don't represent a variable or a function -- they
> just are. In a way they are kind of like enums, but you don't have to
> pre-assign them numbers. Clojure has something similar called
> "keyword symbols". And Ruby has them too just called "symbols". But
> they are much more useful in Erlang b/c of pattern matching.
> 
> So I started wondering, could Forth use such a construct in practice?
> Is there any value in it? Or would it be totally useless to Forth?

: NOP ;

It does nothing.  It does not represent a variable or function, or
even a constant.  It has a name.  It has a unique value too.  That's
called an XT.  As such, it would seem that it just stands for itself.
Is that what you meant?


Rod Pemberton

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


Thread

Any practical use for Atoms? trans <transfire@gmail.com> - 2016-11-14 08:42 -0800
  Re: Any practical use for Atoms? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-11-14 10:48 -0600
    Re: Any practical use for Atoms? Paul Rubin <no.email@nospam.invalid> - 2016-11-14 08:51 -0800
      Re: Any practical use for Atoms? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-11-14 12:03 -0600
        Re: Any practical use for Atoms? Paul Rubin <no.email@nospam.invalid> - 2016-11-15 22:31 -0800
          Re: Any practical use for Atoms? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-11-16 03:01 -0600
  Re: Any practical use for Atoms? Rod Pemberton <NeedNotReplyHere@xrsevnneqk.cem> - 2016-11-14 16:39 -0500
    Re: Any practical use for Atoms? trans <transfire@gmail.com> - 2016-11-14 14:12 -0800
    Re: Any practical use for Atoms? Mark Wills <markwills1970@gmail.com> - 2016-11-15 03:16 -0800
    Re: Any practical use for Atoms? Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2016-11-15 17:46 +0000
      Re: Any practical use for Atoms? trans <transfire@gmail.com> - 2016-11-15 21:00 -0800
        Re: Any practical use for Atoms? albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2016-11-16 11:55 +0100
          Re: Any practical use for Atoms? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-11-17 13:32 +0000
  Re: Any practical use for Atoms? albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2016-11-15 13:21 +0100

csiph-web