Groups | Search | Server Info | Login | Register


Groups > comp.lang.forth > #23587

Re: TRAVERSE-WORDLIST

Newsgroups comp.lang.forth
Subject Re: TRAVERSE-WORDLIST
References (5 earlier) <86d88732-d90e-4400-9897-c216372f1ba0@bh5g2000vbb.googlegroups.com> <85bo7l7tjp.fsf@junk.nocrew.org> <097aa98a-f890-4aa4-b97e-f75182cb4c40@q6g2000vbh.googlegroups.com> <857gi97q46.fsf@junk.nocrew.org> <327edcb6-30f7-4a6f-a7c3-48b7d1aa4fb3@qz2g2000pbb.googlegroups.com>
From Lars Brinkhoff <lars.spam@nocrew.org>
Organization nocrew
Date 2013-06-14 13:39 +0200
Message-ID <85txl0yl8m.fsf@junk.nocrew.org> (permalink)

Show all headers | View raw


Alex McDonald wrote:
> Lars Brinkhoff wrote:
>> \ I'm assuming something like this:
>> \ nt>xt&flag ( nt -- xt 1 | xt -1 )
>>
>> \ Have to return two flags.  One is consumed by traverse-wordlist,
>> \ the other is left on the stack after traverse-wordlist has returned.
>> : ?nt>xt ( caddr u 1 nt -- xt ? 0 0 | caddr u 1 1 )
>>    nip 3dup nt>string compare 0= ( caddr u nt flag )
>>    if
>>       nip nip nt>xt&flag 0 0  \ Remove caddr u and terminate traversal.
>>    else
>>       drop 1 1  \ Remove nt and keep traversing.
>>    then ;
>>
>> : search-wordlist ( caddr u wid -- 0 | xt ? )
>>    1 swap ['] ?nt>xt ( caddr u 1 wid )
>>    traverse-wordlist ( caddr u 1 | xt ? 0 )
>>    if 2drop 0 then ;
>
> I didn't consider TRAVERSE-WORDLIST as a factor of SEARCH-WORDLIST.
> In fact, the specification as it stands would not be adeqaute, as
> TRAVERSE-WORDLIST can return matches that aren't valid.

Firstly, regardless of this, my underlying point was about the double
flags.  There's some extra work going on to communicate to the caller
of TRAVERSE-WORDLIST that there was a match.  That is not to say that
the current design is bad, just that it would possibly be nice if
there were a solution to this.  (Or not, if the cure is worse than the
disease.)


Now in this particular case, TRAVERSE-WORDLIST would only return
invalid matches if it's used to search past the first match, right?
So unless I'm missing something (which may well be the case), I don't
see that my SEARCH-WORDLIST would return those invalid entries.

Would you care to explain more in detail what the problem is?

> : SAMPLE ... ( 1 ) ;
> : TEST ... ;
> : RETURNS ... ;
> : SAMPLE ... ( 2 ) ;
> : SAMPLE ... ( 3 ) ;
> 
> Some systems may permit visiting the node for the second and
> subsequent definitions of SAMPLE. Exceptionally in this case,
> TRAVERSE-WORDLIST *must* visit multiply defined nodes in the order
> newest to oldest (but not necessarily consecutively); that is,
> SAMPLE (3) must be returned before (2), and (2) before (1).

So my use of TRAVERSE-WORDLIST would see SAMPLE (3), and immediately
return is as required by SEARCH-WORDLIST.  Without being confused by
the two other SAMPLE entries.  As far as I can see.

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


Thread

On the importance of standards Joshua Litt <jalitt@gmail.com> - 2013-06-03 22:42 -0700
  Re: On the importance of standards Steve <nospam275@gmail.com> - 2013-06-03 23:59 -0700
    Re: On the importance of standards Alex McDonald <blog@rivadpm.com> - 2013-06-04 06:16 -0700
      Re: On the importance of standards Steve <nospam275@gmail.com> - 2013-06-10 20:51 +1000
        Re: On the importance of standards Alex McDonald <blog@rivadpm.com> - 2013-06-11 22:03 -0700
          Re: On the importance of standards Paul Rubin <no.email@nospam.invalid> - 2013-06-11 22:32 -0700
            Re: On the importance of standards Alex McDonald <blog@rivadpm.com> - 2013-06-12 13:06 -0700
              Re: On the importance of standards Steve <nospam275@gmail.com> - 2013-06-13 22:34 +1000
              Re: On the importance of standards rickman <gnuarm@gmail.com> - 2013-06-14 19:09 -0400
                Re: On the importance of standards Steve <nospam275@gmail.com> - 2013-06-23 19:02 +1000
                Re: On the importance of standards rickman <gnuarm@gmail.com> - 2013-06-23 13:55 -0400
            Re: On the importance of standards Steve <nospam275@gmail.com> - 2013-06-13 22:08 +1000
          Re: On the importance of standards Steve <nospam275@gmail.com> - 2013-06-13 23:28 +1000
            Re: On the importance of standards Mark Wills <markrobertwills@yahoo.co.uk> - 2013-06-13 07:41 -0700
              Re: On the importance of standards Steve <nospam275@gmail.com> - 2013-06-23 19:06 +1000
            Re: On the importance of standards Brad Eckert <hwfwguy@gmail.com> - 2013-06-13 10:10 -0700
              Re: On the importance of standards Steve <nospam275@gmail.com> - 2013-06-23 19:19 +1000
            Re: On the importance of standards Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-13 12:33 -0500
              Re: On the importance of standards Steve <nospam275@gmail.com> - 2013-06-23 19:28 +1000
                Re: On the importance of standards Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-23 11:58 -0500
                Re: On the importance of standards "Alex McDonald" <blog@rivadpm.com> - 2013-06-25 20:00 +0100
            Re: On the importance of standards "Elizabeth D. Rather" <erather@forth.com> - 2013-06-13 07:55 -1000
              Re: On the importance of standards Alex McDonald <blog@rivadpm.com> - 2013-06-13 12:35 -0700
                Re: On the importance of standards Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-13 23:18 +0200
                Re: On the importance of standards Steve <nospam275@gmail.com> - 2013-06-23 19:41 +1000
              Re: On the importance of standards Steve <nospam275@gmail.com> - 2013-06-23 19:37 +1000
            Re: On the importance of standards Alex McDonald <blog@rivadpm.com> - 2013-06-13 12:00 -0700
              Re: On the importance of standards Steve <nospam275@gmail.com> - 2013-06-23 21:41 +1000
                Re: On the importance of standards "Alex McDonald" <blog@rivadpm.com> - 2013-06-25 20:08 +0100
            Re: On the importance of standards rickman <gnuarm@gmail.com> - 2013-06-14 19:16 -0400
              Re: On the importance of standards Steve <nospam275@gmail.com> - 2013-06-23 20:33 +1000
  Re: On the importance of standards Elizabeth D Rather <erather@forth.com> - 2013-06-03 21:32 -1000
    Re: On the importance of standards Steve <nospam275@gmail.com> - 2013-06-04 01:33 -0700
    Re: On the importance of standards Paul Rubin <no.email@nospam.invalid> - 2013-06-04 01:36 -0700
      Re: On the importance of standards albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-06-04 10:14 +0000
      Re: On the importance of standards Alex McDonald <blog@rivadpm.com> - 2013-06-04 05:51 -0700
  Re: On the importance of standards Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-04 05:46 -0500
    Re: On the importance of standards Steve <nospam275@gmail.com> - 2013-06-06 11:13 -0700
      Re: On the importance of standards rickman <gnuarm@gmail.com> - 2013-06-06 16:47 -0400
      Re: On the importance of standards Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-06 21:29 -0500
        Re: On the importance of standards Steve <nospam275@gmail.com> - 2013-06-08 04:26 +1000
  Re: On the importance of standards anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-04 12:03 +0000
  Re: On the importance of standards Alex McDonald <blog@rivadpm.com> - 2013-06-04 06:00 -0700
    Re: On the importance of standards anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-04 13:20 +0000
      Re: On the importance of standards Alex McDonald <blog@rivadpm.com> - 2013-06-04 06:33 -0700
        Re: On the importance of standards anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-04 13:40 +0000
          Re: On the importance of standards Alex McDonald <blog@rivadpm.com> - 2013-06-04 07:42 -0700
            Re: On the importance of standards Lars Brinkhoff <lars.spam@nocrew.org> - 2013-06-04 18:02 +0200
              Re: On the importance of standards Alex McDonald <blog@rivadpm.com> - 2013-06-04 09:07 -0700
                Re: On the importance of standards Lars Brinkhoff <lars.spam@nocrew.org> - 2013-06-04 19:16 +0200
                Re: On the importance of standards rickman <gnuarm@gmail.com> - 2013-06-04 14:27 -0400
                TRAVERSE-WORDLIST (was Re: On the importance of standards) Alex McDonald <blog@rivadpm.com> - 2013-06-13 15:55 -0700
                Re: TRAVERSE-WORDLIST Lars Brinkhoff <lars.spam@nocrew.org> - 2013-06-14 13:39 +0200
                Re: TRAVERSE-WORDLIST Alex McDonald <blog@rivadpm.com> - 2013-06-14 09:06 -0700
                Re: TRAVERSE-WORDLIST anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-17 17:05 +0000
                Re: TRAVERSE-WORDLIST Alex McDonald <blog@rivadpm.com> - 2013-06-17 21:29 -0700
  Re: On the importance of standards stephenXXX@mpeforth.com (Stephen Pelc) - 2013-06-04 13:51 +0000
    Re: On the importance of standards Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-05 01:24 +0200
      Re: On the importance of standards stephenXXX@mpeforth.com (Stephen Pelc) - 2013-06-05 09:25 +0000
        Re: On the importance of standards m.a.m.hendrix@tue.nl - 2013-06-05 04:31 -0700
          Re: On the importance of standards Alex McDonald <blog@rivadpm.com> - 2013-06-05 05:41 -0700
            Re: On the importance of standards mhx@iae.nl (Marcel Hendrix) - 2013-06-05 21:16 +0200
              Re: On the importance of standards Alex McDonald <blog@rivadpm.com> - 2013-06-05 12:41 -0700
          Re: On the importance of standards stephenXXX@mpeforth.com (Stephen Pelc) - 2013-06-05 12:53 +0000
            Re: On the importance of standards Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-06 04:20 +0200
              Re: On the importance of standards m.a.m.hendrix@tue.nl - 2013-06-06 00:06 -0700
                Re: On the importance of standards Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-06 15:32 +0200
                Re: On the importance of standards mhx@iae.nl (Marcel Hendrix) - 2013-06-06 17:09 +0200
                Re: On the importance of standards Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-06 22:44 +0200
                Re: On the importance of standards Roelf Toxopeus <rt4all@notthis.hetnet.nl> - 2013-06-07 10:16 +0200
              Re: On the importance of standards Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-06 21:31 -0500
                Re: On the importance of standards Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-08 00:58 +0200
                Re: On the importance of standards Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-07 22:02 -0500
                Re: On the importance of standards Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-09 00:55 +0200
                C interface (was: On the importance of standards) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-11 15:41 +0000
                Re: C interface (was: On the importance of standards) Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-11 18:45 +0200
                Re: C interface Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-12 08:05 -0500
                Re: C interface anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-12 14:38 +0000
                Re: C interface Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-12 20:15 +0200
                Re: C interface Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-14 22:52 -0500
                Re: C interface Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-12 13:27 -0500
                Re: C interface anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-14 12:51 +0000
                Re: C interface Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-14 22:47 -0500
                Re: C interface anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-17 16:44 +0000
                Re: C interface Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-17 12:46 -0500
                Re: C interface anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-18 07:23 +0000
                Re: C interface Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-18 04:06 -0500
                Re: C interface m.a.m.hendrix@tue.nl - 2013-06-18 03:51 -0700
                Re: C interface anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-18 16:10 +0000
                Re: C interface Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-18 13:24 -0500
          Foreign language interface (was: On the importance of standards) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-05 15:35 +0000
            Re: Foreign language interface (was: On the importance of standards) stephenXXX@mpeforth.com (Stephen Pelc) - 2013-06-05 17:37 +0000
              Re: Foreign language interface (was: On the importance of standards) Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-06 04:28 +0200
              Re: Foreign language interface (was: On the importance of standards) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-14 15:23 +0000
                Re: Foreign language interface (was: On the importance of standards) Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-15 14:33 +0200
            Re: Foreign language interface (was: On the importance of standards) mhx@iae.nl (Marcel Hendrix) - 2013-06-05 21:32 +0200
              Re: Foreign language interface (was: On the importance of standards) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-14 15:05 +0000
                Re: Foreign language interface (was: On the importance of standards) mhx@iae.nl (Marcel Hendrix) - 2013-06-14 21:42 +0200
                Re: Foreign language interface (was: On the importance of standards) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-17 16:53 +0000
            Re: Foreign language interface (was: On the importance of standards) Spam@ControlQ.com - 2013-06-05 16:01 -0400
              Re: Foreign language interface (was: On the importance of  standards) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-14 14:55 +0000
                Re: Foreign language interface (was: On the importance of  standards) Spam@ControlQ.com - 2013-06-14 15:28 -0400
        Re: On the importance of standards Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-06 04:14 +0200
      Re: On the importance of standards glidedog@gmail.com - 2013-06-23 02:55 -0700
    Re: On the importance of standards Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-06 15:25 -0500
  Re: On the importance of standards "Rod Pemberton" <do_not_have@notemailnotq.cpm> - 2013-06-04 17:48 -0400
    Re: On the importance of standards visualforth@rocketmail.com - 2013-06-04 15:06 -0700
    Re: On the importance of standards visualforth@rocketmail.com - 2013-06-04 15:40 -0700
    Re: On the importance of standards Lars Brinkhoff <lars.spam@nocrew.org> - 2013-06-05 07:30 +0200
    Re: On the importance of standards Steve <nospam275@gmail.com> - 2013-06-08 04:33 +1000
  Re: On the importance of standards Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> - 2013-06-05 02:09 +0000
    Re: On the importance of standards Paul Rubin <no.email@nospam.invalid> - 2013-06-04 19:32 -0700
      Re: On the importance of standards Doug Hoffman <glidedog@gmail.com> - 2013-06-05 00:06 -0400
    Re: On the importance of standards rickman <gnuarm@gmail.com> - 2013-06-04 22:50 -0400
    Re: On the importance of standards "Elizabeth D. Rather" <erather@forth.com> - 2013-06-04 19:02 -1000
      Re: On the importance of standards Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> - 2013-06-05 23:16 +0000
        Re: On the importance of standards Elizabeth D Rather <erather@forth.com> - 2013-06-05 13:43 -1000
          Re: On the importance of standards "Ed" <invalid@invalid.com> - 2013-06-06 11:14 +1000
            Re: On the importance of standards Elizabeth D Rather <erather@forth.com> - 2013-06-05 15:27 -1000
              Re: On the importance of standards "Ed" <invalid@invalid.com> - 2013-06-06 15:28 +1000
  Re: On the importance of standards Paul Rubin <no.email@nospam.invalid> - 2013-06-05 00:03 -0700
  Re: On the importance of standards Joshua Litt <jalitt@gmail.com> - 2013-06-06 17:15 -0700
    Re: On the importance of standards "Elizabeth D. Rather" <erather@forth.com> - 2013-06-06 14:45 -1000
      Re: On the importance of standards Joshua Litt <jalitt@gmail.com> - 2013-06-06 19:24 -0700
        Re: On the importance of standards Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-06 21:38 -0500
          Re: On the importance of standards Joshua Litt <jalitt@gmail.com> - 2013-06-07 14:39 -0700
            Re: On the importance of standards Steve <nospam275@gmail.com> - 2013-06-09 00:57 +1000
              Re: On the importance of standards Paul Rubin <no.email@nospam.invalid> - 2013-06-08 10:44 -0700
                Re: On the importance of standards Steve <nospam275@gmail.com> - 2013-06-09 06:11 +1000
                Re: On the importance of standards Paul Rubin <no.email@nospam.invalid> - 2013-06-08 14:47 -0700
                Re: On the importance of standards Steve <nospam275@gmail.com> - 2013-06-10 00:03 +1000
                Re: On the importance of standards rickman <gnuarm@gmail.com> - 2013-06-09 15:00 -0400
                Re: On the importance of standards Paul Rubin <no.email@nospam.invalid> - 2013-06-09 12:26 -0700
                Re: On the importance of standards rickman <gnuarm@gmail.com> - 2013-06-09 15:41 -0400
                Re: On the importance of standards Paul Rubin <no.email@nospam.invalid> - 2013-06-09 13:11 -0700
                Re: On the importance of standards Paul Rubin <no.email@nospam.invalid> - 2013-06-09 13:14 -0700
                Re: On the importance of standards Steve <nospam275@gmail.com> - 2013-06-10 18:41 +1000
                Re: On the importance of standards rickman <gnuarm@gmail.com> - 2013-06-09 17:09 -0400
                Re: On the importance of standards Steve <nospam275@gmail.com> - 2013-06-10 18:35 +1000
                Re: On the importance of standards Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-10 16:04 +0200
                Re: On the importance of standards Paul Rubin <no.email@nospam.invalid> - 2013-06-15 01:08 -0700
                Re: On the importance of standards Steve <nospam275@gmail.com> - 2013-06-10 20:13 +1000
                Re: On the importance of standards rickman <gnuarm@gmail.com> - 2013-06-10 11:35 -0400
                Re: On the importance of standards Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-10 17:37 -0500
                Re: On the importance of standards rickman <gnuarm@gmail.com> - 2013-06-10 18:46 -0400
                Re: On the importance of standards Paul Rubin <no.email@nospam.invalid> - 2013-06-10 16:36 -0700
                Re: On the importance of standards rickman <gnuarm@gmail.com> - 2013-06-10 20:09 -0400
                Re: On the importance of standards Steve <nospam275@gmail.com> - 2013-06-13 21:55 +1000
                Re: On the importance of standards Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-06-11 09:56 -0500
                Re: On the importance of standards Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-11 18:40 +0200
                Re: On the importance of standards rickman <gnuarm@gmail.com> - 2013-06-11 22:36 -0400
                Re: On the importance of standards Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-15 14:30 +0200
                Re: On the importance of standards rickman <gnuarm@gmail.com> - 2013-06-15 19:20 -0400
                Re: On the importance of standards Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-16 22:37 +0200
                Re: On the importance of standards Steve <nospam275@gmail.com> - 2013-06-23 17:14 +1000
                Re: On the importance of standards Steve <nospam275@gmail.com> - 2013-06-13 21:33 +1000
                Re: On the importance of standards rickman <gnuarm@gmail.com> - 2013-06-15 13:21 -0400
                Re: On the importance of standards Steve <nospam275@gmail.com> - 2013-06-23 18:58 +1000
                Re: On the importance of standards rickman <gnuarm@gmail.com> - 2013-06-08 18:42 -0400
                Re: On the importance of standards Steve <nospam275@gmail.com> - 2013-06-09 23:27 +1000
                Re: On the importance of standards "WJ" <w_a_x_man@yahoo.com> - 2013-06-10 16:11 +0000
    Re: On the importance of standards Steve <nospam275@gmail.com> - 2013-06-08 05:11 +1000

csiph-web