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


Groups > comp.lang.forth > #51285

Re: Given a string, create word with that name (in ANS Forth)?

From anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups comp.lang.forth
Subject Re: Given a string, create word with that name (in ANS Forth)?
Date 2016-09-25 15:22 +0000
Organization Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID <2016Sep25.172229@mips.complang.tuwien.ac.at> (permalink)
References (6 earlier) <Tr2dnT8q6sFm0HjKnZ2dnUU7-cGdnZ2d@supernews.com> <2016Sep23.182601@mips.complang.tuwien.ac.at> <5IOdnRy0kb7IoHvKnZ2dnUU7-afNnZ2d@supernews.com> <2016Sep24.121339@mips.complang.tuwien.ac.at> <svqdnYT5RPmWAHvKnZ2dnUU7-c3NnZ2d@supernews.com>

Show all headers | View raw


Andrew Haley <andrew29@littlepinkcloud.invalid> writes:
>Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
>> Andrew Haley <andrew29@littlepinkcloud.invalid> writes:
>>>Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
>>>> Andrew Haley <andrew29@littlepinkcloud.invalid> writes:
>>>>>My take on it is that the dictionary is a very specific structure
>>>>>which is optimized for the job it does.  It doesn't necessarily
>>>>>provide O(1) access, for example.
>>>> 
>>>> So what?  
>>>
>>>That was obvious from the context.
>>>
>>>> There are no performance guarantees anywhere in the Forth
>>>
>>>That was my point.  That was obvious from the context.
>> 
>> Which context?
>
>The context you deleted from the message to which I was replying.

If you mean, in <Tr2dnT8q6sFm0HjKnZ2dnUU7-cGdnZ2d@supernews.com>:

|Lars Brinkhoff <lars.spam@nocrew.org> wrote:
|
|> I guess it comes down to whether you view the dictionary as strictly
|> a symbol table for program identifiers, or if you want to be able to
|> use it as a more generic hash table indexed by strings.

No, I don't see that there is anything obvious from that context.

Looking at it again, maybe you intrepreted his use of "hash table" as
meaning "a O(1) access data structure for an associative array", while
I interpreted it just as "associative array", as has become general
usage (e.g.,
<https://en.wikipedia.org/wiki/Comparison_of_programming_languages_%28mapping%29>
says 'associative arrays (also "mapping", "hash", and "dictionary")'),
and was intended by the original author.

And "hash table" does not imply O(1) access anyway.  E.g., from
earlier postings I know that Forth, Inc. and MPE use hash tables for
wordlists, but they are not O(1) access.

>>>> Why should I use a system-specific interface?
>>>
>>>If the O(1) performance of a hash table is essential to your design,
>> 
>> Where did you get the idea that it was essential?
>
>Note the "if" in the statement above.

Ok, so it's an argument we can ignore.  Let's look at the rest of the
argument: Oops, there is no "otherwise" part, so there is nothing
left.

>Sure, but the system-specific interface *is* needed in the context
>where strings with embedded spaces are used as keys.  (Having said
>that, the strings can be encoded in some way, so the dictionary could
>be used even then, but it would be inconvenient.)

Yes, but in the taxi.fs case converting the numbers to strings was
still much easier than writing my own data structure.

Anyway, the discussion is about whether making something like NEXTNAME
standard may be a good idea.  Arguing that we don't need to make it
standard because it's system-specific at the moment is circular.

>The question which arose was to do with the usage of the dictionary as
>a general-purpose lookup table for arbitrary strings.  The
>disadvantage of the dictionary for that purpose is that its
>performance varies widely

Since when is that an argument?  The performance of the rest of Forth
also varies widely, that has not kept us from using or standardizing it.

> and that it doesn't accept arbitrary
>strings.

More precisely, we have no standard interface for inserting arbitrary
strings (and that's the issue under discussion); lookup
(SEARCH-WORDLIST) works nicely with arbitrary strings.  A more serious
issue is that WORDLISTs are case-insensitive in many systems.

- anton
-- 
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
     New standard: http://www.forth200x.org/forth200x.html
   EuroForth 2016: http://www.euroforth.org/ef16/

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


Thread

Given a string, create word with that name (in ANS Forth)? Alex Dowad <alexinbeijing@gmail.com> - 2016-09-11 06:12 -0700
  Re: Given a string, create word with that name (in ANS Forth)? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-09-11 10:51 -0500
    Re: Given a string, create word with that name (in ANS Forth)? Alex Dowad <alexinbeijing@gmail.com> - 2016-09-11 09:49 -0700
    Re: Given a string, create word with that name (in ANS Forth)? Lars Brinkhoff <lars.spam@nocrew.org> - 2016-09-11 19:57 +0200
      Re: Given a string, create word with that name (in ANS Forth)? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-09-12 02:43 -0500
    Re: Given a string, create word with that name (in ANS Forth)? Paul Rubin <no.email@nospam.invalid> - 2016-09-11 14:31 -0700
  Re: Given a string, create word with that name (in ANS Forth)? hughaguilar96@gmail.com - 2016-09-11 10:14 -0700
  Re: Given a string, create word with that name (in ANS Forth)? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-09-12 07:46 +0000
    Re: Given a string, create word with that name (in ANS Forth)? Paul Rubin <no.email@nospam.invalid> - 2016-09-12 01:10 -0700
      Re: Given a string, create word with that name (in ANS Forth)? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-09-12 09:01 +0000
        Re: Given a string, create word with that name (in ANS Forth)? albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2016-09-12 14:02 +0200
          Re: Given a string, create word with that name (in ANS Forth)? "HAA" <someone@microsoft.com> - 2016-09-20 12:06 +1000
            Re: Given a string, create word with that name (in ANS Forth)? albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2016-09-20 11:27 +0200
        Re: Given a string, create word with that name (in ANS Forth)? Paul Rubin <no.email@nospam.invalid> - 2016-09-12 13:02 -0700
          Re: Given a string, create word with that name (in ANS Forth)? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-09-13 16:20 +0000
            Re: Given a string, create word with that name (in ANS Forth)? albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2016-09-13 21:08 +0200
              Re: Given a string, create word with that name (in ANS Forth)? Paul Rubin <no.email@nospam.invalid> - 2016-09-13 17:30 -0700
                Re: Given a string, create word with that name (in ANS Forth)? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-09-14 07:11 +0000
                Re: Given a string, create word with that name (in ANS Forth)? hughaguilar96@gmail.com - 2016-09-14 18:30 -0700
          Re: Given a string, create word with that name (in ANS Forth)? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-09-15 02:46 -0500
          Re: Given a string, create word with that name (in ANS Forth)? "Elizabeth D. Rather" <erather@forth.com> - 2016-09-20 14:27 -0700
            Re: Given a string, create word with that name (in ANS Forth)? hughaguilar96@gmail.com - 2016-09-20 15:05 -0700
              Re: Given a string, create word with that name (in ANS Forth)? Melzzzzz <Melzzzzz@zzzzz.com> - 2016-09-20 22:19 +0000
            Re: Given a string, create word with that name (in ANS Forth)? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-09-21 12:26 +0000
              Re: Given a string, create word with that name (in ANS Forth)? Coos Haak <htrofhc@gmail.com> - 2016-09-21 15:11 +0200
                Re: Given a string, create word with that name (in ANS Forth)? mhx@iae.nl - 2016-09-21 10:06 -0700
                Re: Given a string, create word with that name (in ANS Forth)? Coos Haak <htrofhc@gmail.com> - 2016-09-21 21:12 +0200
              Re: Given a string, create word with that name (in ANS Forth)? "Elizabeth D. Rather" <erather@forth.com> - 2016-09-21 12:06 -1000
                Re: Given a string, create word with that name (in ANS Forth)? Paul Rubin <no.email@nospam.invalid> - 2016-09-21 15:40 -0700
                Re: Given a string, create word with that name (in ANS Forth)? "HAA" <someone@microsoft.com> - 2016-09-22 13:04 +1000
                Re: Given a string, create word with that name (in ANS Forth)? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-09-22 07:40 +0000
                Re: Given a string, create word with that name (in ANS Forth)? Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2016-09-22 15:46 +0100
                Re: Given a string, create word with that name (in ANS Forth)? hughaguilar96@gmail.com - 2016-09-22 11:08 -0700
                Re: Given a string, create word with that name (in ANS Forth)? Lars Brinkhoff <lars.spam@nocrew.org> - 2016-09-22 22:04 +0200
                Re: Given a string, create word with that name (in ANS Forth)? Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2016-09-23 10:21 +0100
                Re: Given a string, create word with that name (in ANS Forth)? Lars Brinkhoff <lars.spam@nocrew.org> - 2016-09-23 12:06 +0200
                Re: Given a string, create word with that name (in ANS Forth)? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-09-23 10:44 -0500
                Re: Given a string, create word with that name (in ANS Forth)? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-09-23 16:26 +0000
                Re: Given a string, create word with that name (in ANS Forth)? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-09-24 03:46 -0500
                Re: Given a string, create word with that name (in ANS Forth)? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-09-24 10:13 +0000
                Re: Given a string, create word with that name (in ANS Forth)? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-09-24 10:34 -0500
                Re: Given a string, create word with that name (in ANS Forth)? Lars Brinkhoff <lars.spam@nocrew.org> - 2016-09-24 20:19 +0200
                Re: Given a string, create word with that name (in ANS Forth)? "Elizabeth D. Rather" <erather@forth.com> - 2016-09-24 09:47 -1000
                Re: Given a string, create word with that name (in ANS Forth)? Paul Rubin <no.email@nospam.invalid> - 2016-09-24 14:29 -0700
                Re: Given a string, create word with that name (in ANS Forth)? "Elizabeth D. Rather" <erather@forth.com> - 2016-09-24 13:00 -1000
                Re: Given a string, create word with that name (in ANS Forth)? Paul Rubin <no.email@nospam.invalid> - 2016-09-24 16:19 -0700
                Re: Given a string, create word with that name (in ANS Forth)? jim.brakefield@ieee.org - 2016-09-24 19:02 -0700
                Re: Given a string, create word with that name (in ANS Forth)? "Elizabeth D. Rather" <erather@forth.com> - 2016-09-24 21:23 -1000
                Re: Given a string, create word with that name (in ANS Forth)? hughaguilar96@gmail.com - 2016-09-25 19:08 -0700
                Re: Given a string, create word with that name (in ANS Forth)? jim.brakefield@ieee.org - 2016-09-25 19:53 -0700
                Re: Given a string, create word with that name (in ANS Forth)? hughaguilar96@gmail.com - 2016-09-25 20:00 -0700
                Re: Given a string, create word with that name (in ANS Forth)? hughaguilar96@gmail.com - 2016-09-25 17:40 -0700
                Re: Given a string, create word with that name (in ANS Forth)? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-09-25 01:42 -0500
                Re: Given a string, create word with that name (in ANS Forth)? Paul Rubin <no.email@nospam.invalid> - 2016-09-24 23:45 -0700
                Re: Given a string, create word with that name (in ANS Forth)? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-09-25 02:22 -0500
                Re: Given a string, create word with that name (in ANS Forth)? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-09-26 15:31 +0000
                Re: Given a string, create word with that name (in ANS Forth)? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-09-26 10:42 -0500
                Re: Given a string, create word with that name (in ANS Forth)? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-09-27 15:57 +0000
                Re: Given a string, create word with that name (in ANS Forth)? albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2016-09-27 19:11 +0200
                Re: Given a string, create word with that name (in ANS Forth)? "Elizabeth D. Rather" <erather@forth.com> - 2016-09-24 21:28 -1000
                Re: Given a string, create word with that name (in ANS Forth)? hughaguilar96@gmail.com - 2016-09-25 18:55 -0700
                Re: Given a string, create word with that name (in ANS Forth)? Lars Brinkhoff <lars.spam@nocrew.org> - 2016-09-25 09:35 +0200
                Re: Given a string, create word with that name (in ANS Forth)? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-09-26 15:38 +0000
                Re: Given a string, create word with that name (in ANS Forth)? hughaguilar96@gmail.com - 2016-09-26 12:36 -0700
                Re: Given a string, create word with that name (in ANS Forth)? Lars Brinkhoff <lars.spam@nocrew.org> - 2016-09-24 20:26 +0200
                Re: Given a string, create word with that name (in ANS Forth)? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-09-25 15:22 +0000
                Re: Given a string, create word with that name (in ANS Forth)? Paul Rubin <no.email@nospam.invalid> - 2016-09-25 10:44 -0700
                Re: Given a string, create word with that name (in ANS Forth)? Coos Haak <htrofhc@gmail.com> - 2016-09-25 19:55 +0200
                Re: Given a string, create word with that name (in ANS Forth)? albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2016-09-25 20:15 +0200
                Re: Given a string, create word with that name (in ANS Forth)? Coos Haak <htrofhc@gmail.com> - 2016-09-25 20:26 +0200
                Re: Given a string, create word with that name (in ANS Forth)? Paul Rubin <no.email@nospam.invalid> - 2016-09-25 11:12 -0700
                Re: Given a string, create word with that name (in ANS Forth)? Julian Fondren <julian.fondren@gmail.com> - 2016-09-25 11:30 -0700
                Re: Given a string, create word with that name (in ANS Forth)? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-09-26 14:51 +0000
                Re: Given a string, create word with that name (in ANS Forth)? albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2016-09-27 14:16 +0200
                Re: Given a string, create word with that name (in ANS Forth)? "Elizabeth D. Rather" <erather@forth.com> - 2016-09-23 07:52 -1000
                Re: Given a string, create word with that name (in ANS Forth)? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-09-23 10:36 -0500
    Re: Given a string, create word with that name (in ANS Forth)? albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2016-09-12 13:55 +0200
      Re: Given a string, create word with that name (in ANS Forth)? Lars Brinkhoff <lars.spam@nocrew.org> - 2016-09-12 15:01 +0200
      Re: Given a string, create word with that name (in ANS Forth)? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-09-12 17:29 +0000
        Re: Given a string, create word with that name (in ANS Forth)? albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2016-09-12 21:02 +0200
          Re: Given a string, create word with that name (in ANS Forth)? Paul Rubin <no.email@nospam.invalid> - 2016-09-12 13:04 -0700
            Re: Given a string, create word with that name (in ANS Forth)? albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2016-09-12 22:33 +0200
              Re: Given a string, create word with that name (in ANS Forth)? lawrencedo99@gmail.com - 2016-09-16 18:38 -0700
                Re: Given a string, create word with that name (in ANS Forth)? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-09-17 05:33 +0000
                Re: Given a string, create word with that name (in ANS Forth)? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2016-09-17 01:40 -0500
                Re: Given a string, create word with that name (in ANS Forth)? lawrencedo99@gmail.com - 2016-09-16 23:47 -0700
                Re: Given a string, create word with that name (in ANS Forth)? Julian Fondren <julian.fondren@gmail.com> - 2016-09-17 00:08 -0700
                Re: Given a string, create word with that name (in ANS Forth)? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-09-17 17:03 +0000
            Re: Given a string, create word with that name (in ANS Forth)? albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2016-09-12 22:35 +0200
            Re: Given a string, create word with that name (in ANS Forth)? Jan Coombs <jenfhaomndgfwutc@murmic.plus.com> - 2016-09-17 08:16 +0100
  Re: Given a string, create word with that name (in ANS Forth)? Mark Wills <markwills1970@gmail.com> - 2016-09-12 02:49 -0700
    Re: Given a string, create word with that name (in ANS Forth)? albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2016-09-12 14:04 +0200
    Re: Given a string, create word with that name (in ANS Forth)? Cecil Bayona <cbayona@cbayona.com> - 2016-09-12 09:34 -0500
      Re: Given a string, create word with that name (in ANS Forth)? Mark Wills <markwills1970@gmail.com> - 2016-09-12 08:10 -0700
        Re: Given a string, create word with that name (in ANS Forth)? Cecil Bayona <cbayona@cbayona.com> - 2016-09-12 12:02 -0500
  Re: Given a string, create word with that name (in ANS Forth)? albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2016-09-12 14:08 +0200

csiph-web