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


Groups > comp.lang.forth > #16981

Re: Is there a better way?

From rickman <gnuarm@gmail.com>
Newsgroups comp.lang.forth
Subject Re: Is there a better way?
Date 2012-11-02 13:13 -0400
Organization A noiseless patient Spider
Message-ID <k70uvm$oo0$1@dont-email.me> (permalink)
References <70a117c1-ba9f-474b-97f3-6440be3d4573@k20g2000vbj.googlegroups.com> <94b910d2-a889-4925-b86a-a5b205d3e79f@googlegroups.com>

Show all headers | View raw


On 11/2/2012 4:10 AM, Charles Mélice wrote:
> What about:
>
> : }}?  ( a n -- flag )
> 	2 = if h@ 0x7D7D = else drop false then ;

You are using the conditional to temporarily store the flag from the 2 
=.  I prefer to do it like this.

: }}? ( a n -- a n flag )
   over h@ 0x7D7D over 2 = AND ;

I duped the inputs because that is what the OP specified for the 
routine.  But you see the point of using stack logic rather than the PC 
to store the result of the 2 = and perform the AND.  I won't say one is 
more clear than the other because I think that is just what you are used 
to.  I'm used to simple logic to generate flags.  If the logic was more 
complex then maybe conditional execution would be a better way to 
express it.

Rick

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


Thread

Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-10-31 04:58 -0700
  Re: Is there a better way? Paul Rubin <no.email@nospam.invalid> - 2012-10-31 05:22 -0700
    Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-10-31 05:44 -0700
      Re: Is there a better way? "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-10-31 11:29 -0400
        Re: Is there a better way? "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-10-31 11:40 -0400
          Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-10-31 08:45 -0700
            Re: Is there a better way? "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-11-02 04:48 -0400
          Re: Is there a better way? rickman <gnuarm@gmail.com> - 2012-10-31 21:42 -0400
            Re: Is there a better way? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-11-01 19:19 -0700
              Re: Is there a better way? rickman <gnuarm@gmail.com> - 2012-11-02 13:06 -0400
                Re: Is there a better way? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-02 12:18 -0500
                Re: Is there a better way? rickman <gnuarm@gmail.com> - 2012-11-02 14:34 -0400
                Re: Is there a better way? Paul Rubin <no.email@nospam.invalid> - 2012-11-02 11:39 -0700
                Re: Is there a better way? rickman <gnuarm@gmail.com> - 2012-11-02 14:43 -0400
                Re: Is there a better way? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-04 02:36 -0600
                Re: Is there a better way? rickman <gnuarm@gmail.com> - 2012-11-04 14:18 -0500
                Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-11-02 14:38 -0700
                Re: Is there a better way? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-04 03:01 -0600
                Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-11-04 03:54 -0800
                Re: Is there a better way? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-04 07:59 -0600
                Re: Is there a better way? Elizabeth D Rather <erather@forth.com> - 2012-11-04 08:34 -1000
                Re: Is there a better way? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-11-04 15:22 -0800
                Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-11-05 02:39 -0800
                Words consuming arguments, was [Re: Is there a better way?] "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-11-05 14:01 -0500
                Re: Words consuming arguments, was [Re: Is there a better way?] "Elizabeth D. Rather" <erather@forth.com> - 2012-11-05 10:39 -1000
                Re: Words consuming arguments, was [Re: Is there a better way?] Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-11-05 21:07 -0800
                Re: Words consuming arguments, was [Re: Is there a better way?] "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-11-06 20:57 -0500
                Re: Words consuming arguments, was [Re: Is there a better way?] Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-11-06 21:43 -0800
                Re: Words consuming arguments, was [Re: Is there a better way?] Mark Wills <forthfreak@gmail.com> - 2012-11-07 03:52 -0800
                Re: Words consuming arguments, was [Re: Is there a better way?] "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-11-07 19:55 -0500
                Re: Words consuming arguments, was [Re: Is there a better way?] "Elizabeth D. Rather" <erather@forth.com> - 2012-11-07 20:46 -1000
                Re: Words consuming arguments, was [Re: Is there a better way?] stephenXXX@mpeforth.com (Stephen Pelc) - 2012-11-08 10:39 +0000
                Re: Words consuming arguments, was [Re: Is there a better way?] Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-12 03:48 -0600
                Re: Words consuming arguments, was [Re: Is there a better way?] "Elizabeth D. Rather" <erather@forth.com> - 2012-11-12 07:57 -1000
                Re: Words consuming arguments, was [Re: Is there a better way?] "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-11-12 19:50 -0500
                Re: Words consuming arguments, was [Re: Is there a better way?] "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-11-12 19:49 -0500
                Re: Words consuming arguments, was [Re: Is there a better way?] "Elizabeth D. Rather" <erather@forth.com> - 2012-11-12 15:00 -1000
                Re: Words consuming arguments, was [Re: Is there a better way?] Mark Wills <forthfreak@gmail.com> - 2012-11-13 00:50 -0800
                Re: Words consuming arguments, was [Re: Is there a better way?] Mark Wills <forthfreak@gmail.com> - 2012-11-13 00:58 -0800
                Re: Words consuming arguments, was [Re: Is there a better way?] "Elizabeth D. Rather" <erather@forth.com> - 2012-11-12 23:17 -1000
                Re: Words consuming arguments, was [Re: Is there a better way?] albert@spenarnc.xs4all.nl (Albert van der Horst) - 2012-11-13 13:44 +0000
                Re: Words consuming arguments, was [Re: Is there a better way?] anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-11-13 13:53 +0000
                Re: Words consuming arguments, was [Re: Is there a better way?] Alex McDonald <blog@rivadpm.com> - 2012-11-13 06:39 -0800
                Re: Words consuming arguments, was [Re: Is there a better way?] anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-11-13 18:02 +0000
                Re: Words consuming arguments, was [Re: Is there a better way?] Alex McDonald <blog@rivadpm.com> - 2012-11-13 12:10 -0800
                Re: Words consuming arguments, was [Re: Is there a better way?] anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-11-15 16:59 +0000
                Re: Words consuming arguments, was [Re: Is there a better way?] Mark Wills <forthfreak@gmail.com> - 2012-11-13 07:55 -0800
                Re: Words consuming arguments, was [Re: Is there a better way?] "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-11-14 06:34 -0500
                Re: Words consuming arguments, was [Re: Is there a better way?] Mark Wills <forthfreak@gmail.com> - 2012-11-14 05:01 -0800
                Re: Words consuming arguments, was [Re: Is there a better way?] albert@spenarnc.xs4all.nl (Albert van der Horst) - 2012-11-14 16:11 +0000
                Re: Words consuming arguments, was [Re: Is there a better way?] "Elizabeth D. Rather" <erather@forth.com> - 2012-11-14 09:36 -1000
                Re: Words consuming arguments, was [Re: Is there a better way?] humptydumpty <ouatubi@gmail.com> - 2012-11-14 12:19 -0800
                Re: Words consuming arguments, was [Re: Is there a better way?] Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-13 10:20 -0600
                Re: Words consuming arguments, was [Re: Is there a better way?] Brad Eckert <hwfwguy@gmail.com> - 2012-11-13 08:50 -0800
                Re: Words consuming arguments, was [Re: Is there a better way?] "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-11-14 06:42 -0500
                Re: Words consuming arguments, was [Re: Is there a better way?] stephenXXX@mpeforth.com (Stephen Pelc) - 2012-11-14 14:14 +0000
                Re: Words consuming arguments, was [Re: Is there a better way?] anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-11-14 15:28 +0000
                Re: Words consuming arguments, was [Re: Is there a better way?] Bernd Paysan <bernd.paysan@gmx.de> - 2012-11-14 17:54 +0100
                Re: Words consuming arguments, was [Re: Is there a better way?] Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-11-14 15:01 -0800
                Re: Words consuming arguments, was [Re: Is there a better way?] Mark Wills <forthfreak@gmail.com> - 2012-11-15 00:08 -0800
                Strings (was: Words consuming arguments) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-11-15 15:18 +0000
                Re: Strings (was: Words consuming arguments) albert@spenarnc.xs4all.nl (Albert van der Horst) - 2012-11-15 16:36 +0000
                Re: Strings (was: Words consuming arguments) "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-11-15 18:35 -0500
                Re: Strings (was: Words consuming arguments) stephenXXX@mpeforth.com (Stephen Pelc) - 2012-11-16 00:36 +0000
                Re: Strings (was: Words consuming arguments) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-11-16 17:42 +0000
                Re: Strings (was: Words consuming arguments) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-11-16 17:55 +0000
                Re: Words consuming arguments, was [Re: Is there a better way?] Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-11-17 04:18 -0800
                Re: Words consuming arguments, was [Re: Is there a better way?] Alex McDonald <blog@rivadpm.com> - 2012-11-17 04:56 -0800
                Re: Words consuming arguments, was [Re: Is there a better way?] "Elizabeth D. Rather" <erather@forth.com> - 2012-11-17 07:24 -1000
                Re: Words consuming arguments, was [Re: Is there a better way?] Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-11-19 15:58 -0800
                Re: Words consuming arguments, was [Re: Is there a better way?] Brad Eckert <hwfwguy@gmail.com> - 2012-11-20 08:17 -0800
                Re: Words consuming arguments, was [Re: Is there a better way?] "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-11-14 06:30 -0500
                Re: Words consuming arguments, was [Re: Is there a better way?] "Elizabeth D. Rather" <erather@forth.com> - 2012-11-14 09:06 -1000
                Re: Words consuming arguments, was [Re: Is there a better way?] "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-11-15 06:18 -0500
                Re: Words consuming arguments, was [Re: Is there a better way?] Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-13 04:26 -0600
                Re: Words consuming arguments, was [Re: Is there a better way?] "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-11-14 06:29 -0500
                Re: Words consuming arguments, was [Re: Is there a better way?] Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-14 06:03 -0600
                Re: Words consuming arguments, was [Re: Is there a better way?] "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-11-15 07:15 -0500
                Re: Words consuming arguments, was [Re: Is there a better way?] Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-15 11:51 -0600
                Re: Words consuming arguments, was [Re: Is there a better way?] "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-11-15 18:44 -0500
                Re: Words consuming arguments, was [Re: Is there a better way?] Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-16 03:50 -0600
                Re: Words consuming arguments, was [Re: Is there a better way?] "Elizabeth D. Rather" <erather@forth.com> - 2012-11-15 08:09 -1000
                Re: Words consuming arguments, was [Re: Is there a better way?] "Elizabeth D. Rather" <erather@forth.com> - 2012-11-06 21:19 -1000
                Re: Words consuming arguments, was [Re: Is there a better way?] "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-11-07 20:00 -0500
                Re: Words consuming arguments, was [Re: Is there a better way?] stephenXXX@mpeforth.com (Stephen Pelc) - 2012-11-08 10:49 +0000
                Re: Words consuming arguments, was [Re: Is there a better way?] albert@spenarnc.xs4all.nl (Albert van der Horst) - 2012-11-07 14:01 +0000
                Re: Is there a better way? awegel@arcor.de (Alex Wegel) - 2012-11-04 11:07 +0100
                Re: Is there a better way? awegel@arcor.de (Alex Wegel) - 2012-11-04 11:36 +0100
                Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-11-04 03:48 -0800
                Re: Is there a better way? awegel@arcor.de (Alex Wegel) - 2012-11-04 13:31 +0100
                Re: Is there a better way? Coos Haak <chforth@hccnet.nl> - 2012-11-04 13:29 +0100
                Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-11-04 04:42 -0800
                Re: Is there a better way? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-04 02:38 -0600
    Re: Is there a better way? Doug Hoffman <glidedog@gmail.com> - 2012-10-31 10:20 -0400
  Re: Is there a better way? humptydumpty <ouatubi@gmail.com> - 2012-10-31 05:53 -0700
  Re: Is there a better way? Doug Hoffman <glidedog@gmail.com> - 2012-10-31 09:23 -0400
    Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-10-31 06:41 -0700
      Re: Is there a better way? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-10-31 11:46 -0500
        Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-10-31 14:27 -0700
          Re: Is there a better way? Paul Rubin <no.email@nospam.invalid> - 2012-10-31 14:32 -0700
            Re: Is there a better way? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-10-31 16:15 -0700
          Re: Is there a better way? Coos Haak <chforth@hccnet.nl> - 2012-10-31 22:49 +0100
          Re: Is there a better way? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-10-31 17:13 -0500
            Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-10-31 23:39 -0700
              Re: Is there a better way? "Elizabeth D. Rather" <erather@forth.com> - 2012-10-31 20:58 -1000
              Re: Is there a better way? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-11-01 02:04 -0700
          Re: Is there a better way? "Rod Pemberton" <do_not_have@notemailnotz.cnm> - 2012-10-31 19:13 -0400
          Re: Is there a better way? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-11-02 17:31 +0000
            Re: Is there a better way? Paul Rubin <no.email@nospam.invalid> - 2012-11-02 10:37 -0700
              Re: Is there a better way? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-11-02 18:12 +0000
                Re: Is there a better way? "Elizabeth D. Rather" <erather@forth.com> - 2012-11-02 08:29 -1000
                Re: Is there a better way? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-11-05 14:53 +0000
                Re: Is there a better way? Paul Rubin <no.email@nospam.invalid> - 2012-11-02 11:30 -0700
                Re: Is there a better way? Bernd Paysan <bernd.paysan@gmx.de> - 2012-11-03 00:15 +0100
                Re: Is there a better way? rickman <gnuarm@gmail.com> - 2012-11-02 19:21 -0400
                Re: Is there a better way? Bernd Paysan <bernd.paysan@gmx.de> - 2012-11-03 00:42 +0100
                Re: Is there a better way? rickman <gnuarm@gmail.com> - 2012-11-02 20:21 -0400
                Re: Is there a better way? Bernd Paysan <bernd.paysan@gmx.de> - 2012-11-03 01:44 +0100
                Re: Is there a better way? rickman <gnuarm@gmail.com> - 2012-11-03 12:12 -0400
                Re: Is there a better way? Bernd Paysan <bernd.paysan@gmx.de> - 2012-11-03 18:24 +0100
                Re: Is there a better way? rickman <gnuarm@gmail.com> - 2012-11-03 14:00 -0400
                Re: Is there a better way? Paul Rubin <no.email@nospam.invalid> - 2012-11-03 10:29 -0700
                Re: Is there a better way? Paul Rubin <no.email@nospam.invalid> - 2012-11-02 18:42 -0700
                Re: Is there a better way? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-11-05 11:45 +0000
        Re: Is there a better way? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2012-11-01 21:00 +0000
  Re: Is there a better way? albert@spenarnc.xs4all.nl (Albert van der Horst) - 2012-10-31 15:26 +0000
    Re: Is there a better way? Doug Hoffman <glidedog@gmail.com> - 2012-10-31 12:22 -0400
      Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-10-31 15:07 -0700
        Re: Is there a better way? Doug Hoffman <glidedog@gmail.com> - 2012-10-31 19:16 -0400
          Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-11-01 06:31 -0700
            Re: Is there a better way? Doug Hoffman <glidedog@gmail.com> - 2012-11-01 10:34 -0400
              Re: Is there a better way? Doug Hoffman <glidedog@gmail.com> - 2012-11-01 10:48 -0400
                Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-11-01 08:55 -0700
              Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-11-01 08:49 -0700
                Re: Is there a better way? Doug Hoffman <glidedog@gmail.com> - 2012-11-01 12:46 -0400
            Re: Is there a better way? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-01 09:37 -0500
            Re: Is there a better way? Paul Rubin <no.email@nospam.invalid> - 2012-11-01 07:41 -0700
              Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-11-01 08:52 -0700
                Re: Is there a better way? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-01 12:18 -0500
                Re: Is there a better way? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-11-01 19:38 -0700
                Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-11-02 02:29 -0700
                Re: Is there a better way? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-11-04 21:48 -0800
                Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-11-05 02:44 -0800
            Re: Is there a better way? Graham NEWS <gray@forthman.plus.com> - 2012-11-01 15:52 +0000
          Re: Is there a better way? Josh Grams <josh@qualdan.com> - 2012-11-03 16:38 +0000
    Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-10-31 14:26 -0700
      Re: Is there a better way? rickman <gnuarm@gmail.com> - 2012-11-01 13:42 -0400
  Re: Is there a better way? Graham <""gray\"@forthman@plus.com"> - 2012-10-31 17:05 +0000
    Re: Is there a better way? Peter Fälth <peter.falth@tin.it> - 2012-10-31 12:07 -0700
      Re: Is there a better way? Paul Rubin <no.email@nospam.invalid> - 2012-10-31 12:12 -0700
        Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-10-31 14:17 -0700
    Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-10-31 14:21 -0700
      Re: Is there a better way? Pablo Hugo Reda <pabloreda@gmail.com> - 2012-10-31 14:50 -0700
        Re: Is there a better way? Pablo Hugo Reda <pabloreda@gmail.com> - 2012-10-31 14:51 -0700
          Re: Is there a better way? Paul Rubin <no.email@nospam.invalid> - 2012-10-31 14:57 -0700
            Re: Is there a better way? Coos Haak <chforth@hccnet.nl> - 2012-10-31 23:47 +0100
              Re: Is there a better way? mhx@iae.nl (Marcel Hendrix) - 2012-11-01 21:28 +0200
        Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-10-31 15:11 -0700
          Re: Is there a better way? Pablo Hugo Reda <pabloreda@gmail.com> - 2012-10-31 15:44 -0700
            Re: Is there a better way? rickman <gnuarm@gmail.com> - 2012-11-01 13:55 -0400
  Re: Is there a better way? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-10-31 16:10 -0700
  Re: Is there a better way? Charles Mélice <charles.melice@gmail.com> - 2012-11-02 01:10 -0700
    Re: Is there a better way? Charles Mélice <charles.melice@gmail.com> - 2012-11-02 01:18 -0700
    Re: Is there a better way? Mark Wills <forthfreak@gmail.com> - 2012-11-02 01:58 -0700
      Re: Is there a better way? Charles Mélice <charles.melice@gmail.com> - 2012-11-02 02:14 -0700
        Re: Is there a better way? Charles Mélice <charles.melice@gmail.com> - 2012-11-02 02:16 -0700
          Re: Is there a better way? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-11-02 06:16 -0500
            Re: Is there a better way? Charles Mélice <charles.melice@gmail.com> - 2012-11-02 06:04 -0700
    Re: Is there a better way? rickman <gnuarm@gmail.com> - 2012-11-02 13:13 -0400

csiph-web