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


Groups > comp.lang.forth > #10442

Re: Which standard?

From "Rod Pemberton" <do_not_have@noavailemail.cmm>
Newsgroups comp.lang.forth
Subject Re: Which standard?
Date 2012-03-25 05:47 -0400
Organization Aioe.org NNTP Server
Message-ID <jkmpj7$odb$1@speranza.aioe.org> (permalink)
References (4 earlier) <4f6ce7cd$0$6900$e4fe514c@news2.news.xs4all.nl> <jkj7om$tlv$1@speranza.aioe.org> <4f6da789$0$6930$e4fe514c@news2.news.xs4all.nl> <jkle53$kg$1@speranza.aioe.org> <4f6e69ee$0$6866$e4fe514c@news2.news.xs4all.nl>

Show all headers | View raw


"Hans Bezemer" <the.beez.speaks@gmail.com> wrote in message
news:4f6e69ee$0$6866$e4fe514c@news2.news.xs4all.nl...
> Rod Pemberton wrote:
...

> > If you like C's operators, why don't you define all the C binary
> > operators, logical operators, and assignment operators for Forth
> > and use them?
>
> Sure, introduce some more non-standard operators.

What do you mean non-standard?  They're standard.  ANSI C standard ...

Since you apparently think Forth has an insufficient quantity of operators,
I don't see how you're ever going to solve the problem of introducing "some
more non-standard operators".  You don't write the Forth specifications.

> Would it have been so hard to make a family of logical operators?

No, it wouldn't have been hard.  Apparently, that's not an issue for Forth
since it's simple to do and yet not present.

> Why not NOT, ANY, BOTH on one side and INVERT,
> AND and OR on the other side?

You mean NOT, ANY, and BOTH are logical operators?  How do you intend to
check that the values to ANY and BOTH are booleans?  If you don't plan on
checking, then how are ANY and BOTH different from OR and AND respectively?

> A set of logical operators would largely have
> killed the need for 0= and 0<> - and taken one word more. Big deal.
>
> We could have been writing code like:
>
>         r@ 3 /mod swap not both both
>
> Instead of:
>
>         r@ 3 /mod 0<> swap 0= and and
>
> It may be me, but I understand the first one better. It looks better too.
>

One of the reasons I like C is because the syntax for names of objects and
language elements are alphabetic, numeric, or both while the syntax for
operators are purely symbolic.  It keeps the language easy to read ...

Converting part of those to C syntax (unchecked as to correctness):

         r@ 3 /mod swap ! && &&
         r@ 3 /mod 0 != swap 0 = & &

! is logical not, && is logical and, != is logical not equal, & is binary
and, etc.

C doesn't have an exact equivalent to /mod, it has / for division and % for
remainder:

  2DUP / -ROT %

But, in Forth, / could be redefined to compute both quotient and remainder
like /MOD.  However, it would only place the quotient on the stack and store
the remainder.  Then, % could retrieve the remainder when needed, reducing
that to:

  / %

So, we could end up with something like this:

         r@ 3 / % swap ! && &&
         r@ 3 / % 0 != swap 0 = & &


Rod Pemberton


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


Thread

Which standard? Nomen Nescio <nobody@dizum.com> - 2012-03-21 15:13 +0100
  Re: Which standard? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-03-21 10:37 -0500
    Re: Which standard? Nomen Nescio <nobody@dizum.com> - 2012-03-21 20:23 +0100
      Re: Which standard? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-03-22 13:34 -0500
        Re: Which standard? Nomen Nescio <nobody@dizum.com> - 2012-03-26 20:40 +0200
          Re: Which standard? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-03-26 15:00 -0500
            Re: Which standard? "Elizabeth D. Rather" <erather@forth.com> - 2012-03-26 11:18 -1000
              Re: Which standard? Bernd Paysan <bernd.paysan@gmx.de> - 2012-03-27 02:20 +0200
          Re: Which standard? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-03-27 10:10 +0000
            Re: Which standard? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-03-27 08:31 -0500
            Re: Which standard? Fritz Wuehler <fritz@spamexpire-201203.rodent.frell.theremailer.net> - 2012-03-27 17:08 +0200
              Re: Which standard? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-03-27 11:31 -0500
                Re: Which standard? Helmar Wodtke <helmwo@gmail.com> - 2012-03-27 09:35 -0700
                Re: Which standard? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-03-27 11:47 -0500
                Re: Which standard? Helmar Wodtke <helmwo@gmail.com> - 2012-03-27 10:15 -0700
                Re: Which standard? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-03-27 12:33 -0500
        Re: Which standard? Fritz Wuehler <fritz@spamexpire-201203.rodent.frell.theremailer.net> - 2012-03-26 21:00 +0200
          Re: Which standard? BruceMcF <agila61@netscape.net> - 2012-03-26 13:17 -0700
            Re: Which standard? "Elizabeth D. Rather" <erather@forth.com> - 2012-03-26 11:24 -1000
              Re: Which standard? Fritz Wuehler <fritz@spamexpire-201203.rodent.frell.theremailer.net> - 2012-03-27 17:07 +0200
          Re: Which standard? "Peter Knaggs" <pjk@bcs.org.uk> - 2012-03-27 00:54 +0100
    Re: Which standard? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-03-21 14:09 -0700
  Re: Which standard? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-03-21 15:47 +0000
    Re: Which standard? Nomen Nescio <nobody@dizum.com> - 2012-03-21 20:13 +0100
      Re: Which standard? BruceMcF <agila61@netscape.net> - 2012-03-21 15:07 -0700
      Re: Which standard? stephenXXX@mpeforth.com (Stephen Pelc) - 2012-03-22 10:14 +0000
        Re: Which standard? Nomen Nescio <nobody@dizum.com> - 2012-03-22 16:36 +0100
          Re: Which standard? "Elizabeth D. Rather" <erather@forth.com> - 2012-03-22 08:47 -1000
            Re: Which standard? Fritz Wuehler <fritz@spamexpire-201203.rodent.frell.theremailer.net> - 2012-03-23 15:19 +0100
              Re: Which standard? BruceMcF <agila61@netscape.net> - 2012-03-23 07:48 -0700
              Re: Which standard? "Peter Knaggs" <pjk@bcs.org.uk> - 2012-03-23 17:28 +0000
                Re: Which standard? Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2012-03-23 20:51 +0000
                Re: Which standard? "Peter Knaggs" <pjk@bcs.org.uk> - 2012-03-24 00:47 +0000
              Re: Which standard? "Elizabeth D. Rather" <erather@forth.com> - 2012-03-23 08:40 -1000
                Re: Which standard? Fritz Wuehler <fritz@spamexpire-201203.rodent.frell.theremailer.net> - 2012-03-26 04:42 +0200
              Re: Which standard? Bernd Paysan <bernd.paysan@gmx.de> - 2012-03-26 19:17 +0200
          Re: Which standard? Paul Rubin <no.email@nospam.invalid> - 2012-03-22 13:03 -0700
            Re: Which standard? Fritz Wuehler <fritz@spamexpire-201203.rodent.frell.theremailer.net> - 2012-03-23 19:20 +0100
          Re: Which standard? stephenXXX@mpeforth.com (Stephen Pelc) - 2012-03-22 21:15 +0000
          Re: Which standard? "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-03-22 17:54 -0400
            Re: Which standard? "The Other Rod Pemberton" <dontaskdonttell@pemberton.it> - 2012-03-23 18:12 +0100
              Re: Which standard? "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-03-23 20:39 -0400
                Re: Which standard? "Elizabeth D. Rather" <erather@forth.com> - 2012-03-23 16:05 -1000
                Re: Which standard? Paul Rubin <no.email@nospam.invalid> - 2012-03-23 23:11 -0700
                Re: Which standard? "A. K." <akk@nospam.org> - 2012-03-24 09:15 +0100
                Re: Which standard? "Elizabeth D. Rather" <erather@forth.com> - 2012-03-23 22:52 -1000
                Re: Which standard? "A. K." <akk@nospam.org> - 2012-03-24 10:16 +0100
                Re: Which standard? Paul Rubin <no.email@nospam.invalid> - 2012-03-24 11:25 -0700
                Re: Which standard? Mark Wills <markrobertwills@yahoo.co.uk> - 2012-03-24 04:17 -0700
                Re: Which standard? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-03-26 21:46 -0700
                Re: Which standard? Mark Wills <markrobertwills@yahoo.co.uk> - 2012-03-27 02:49 -0700
                Re: Which standard? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-03-27 22:45 -0700
              Re: Which standard? Paul Rubin <no.email@nospam.invalid> - 2012-03-23 23:06 -0700
                Re: Which standard? Fritz Wuehler <fritz@spamexpire-201203.rodent.frell.theremailer.net> - 2012-03-26 01:51 +0200
          Re: Which standard? Paul Rubin <no.email@nospam.invalid> - 2012-03-22 14:57 -0700
            Re: Which standard? Nomen Nescio <nobody@dizum.com> - 2012-03-23 12:48 +0100
      Re: Which standard? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-03-22 17:50 +0000
    Re: Which standard? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-03-21 13:37 -0700
  Re: Which standard? "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-03-21 17:07 -0400
    Re: Which standard? Nomen Nescio <nobody@dizum.com> - 2012-03-22 09:27 +0100
      Re: Which standard? hwfwguy@gmail.com - 2012-03-22 12:06 -0700
      Re: Which standard? "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-03-22 19:19 -0400
        Re: Which standard? Fritz Wuehler <fritz@spamexpire-201203.rodent.frell.theremailer.net> - 2012-03-23 13:02 +0100
    Re: Which standard? BruceMcF <agila61@netscape.net> - 2012-03-22 08:17 -0700
      Re: Which standard? "Elizabeth D. Rather" <erather@forth.com> - 2012-03-22 08:25 -1000
        Re: Which standard? Hans Bezemer <the.beez.speaks@gmail.com> - 2012-03-23 21:50 +0100
          Re: Which standard? "Elizabeth D. Rather" <erather@forth.com> - 2012-03-23 13:10 -1000
          Re: Which standard? Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-03-24 11:19 +0000
            Re: Which standard? "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-03-25 07:55 -0400
              Re: Which standard? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-03-26 09:12 +0000
          Re: Which standard? Mark Wills <markrobertwills@yahoo.co.uk> - 2012-03-24 04:06 -0700
        Re: Which standard? Fritz Wuehler <fritz@spamexpire-201203.rodent.frell.theremailer.net> - 2012-03-27 21:03 +0200
  Re: Which standard? Hans Bezemer <the.beez.speaks@gmail.com> - 2012-03-21 22:28 +0100
    Re: Which standard? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-03-21 16:36 -0700
      Re: Which standard? "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-03-22 05:15 -0400
        Re: Which standard? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-03-22 12:16 +0000
        Re: Which standard? Fritz Wuehler <fritz@spamexpire-201203.rodent.frell.theremailer.net> - 2012-03-23 01:26 +0100
          Re: Which standard? "Elizabeth D. Rather" <erather@forth.com> - 2012-03-22 15:37 -1000
            Re: Which standard? Fritz Wuehler <fritz@spamexpire-201203.rodent.frell.theremailer.net> - 2012-03-25 22:24 +0200
            Re: Which standard? "Peter Knaggs" <pjk@bcs.org.uk> - 2012-03-26 10:49 +0100
        Re: Which standard? Hans Bezemer <the.beez.speaks@gmail.com> - 2012-03-23 20:00 +0100
          Re: Which standard? "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-03-23 21:21 -0400
            Re: Which standard? Hans Bezemer <the.beez.speaks@gmail.com> - 2012-03-24 11:44 +0100
              Re: Which standard? Bernd Paysan <bernd.paysan@gmx.de> - 2012-03-26 18:51 +0200
        Re: Which standard? Hans Bezemer <the.beez.speaks@gmail.com> - 2012-03-23 22:16 +0100
          Re: Which standard? "Elizabeth D. Rather" <erather@forth.com> - 2012-03-23 13:21 -1000
            Re: Which standard? Hans Bezemer <the.beez.speaks@gmail.com> - 2012-03-24 01:33 +0100
              Re: Which standard? "Elizabeth D. Rather" <erather@forth.com> - 2012-03-23 16:06 -1000
                Re: Which standard? Hans Bezemer <the.beez.speaks@gmail.com> - 2012-03-24 11:44 +0100
              Re: Which standard? Jan Coombs <jan_2011-02@murray-microft.co.uk> - 2012-03-24 10:08 +0000
                Re: Which standard? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-03-24 14:31 +0000
          Re: Which standard? "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-03-23 21:24 -0400
            Re: Which standard? Hans Bezemer <the.beez.speaks@gmail.com> - 2012-03-24 11:54 +0100
              Re: Which standard? "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-03-24 17:25 -0400
                Re: Which standard? "Elizabeth D. Rather" <erather@forth.com> - 2012-03-24 13:43 -1000
                Re: Which standard? Hans Bezemer <the.beez.speaks@gmail.com> - 2012-03-25 01:43 +0100
                Re: Which standard? "Elizabeth D. Rather" <erather@forth.com> - 2012-03-24 15:56 -1000
                Re: Which standard? Hans Bezemer <the.beez.speaks@gmail.com> - 2012-03-25 22:49 +0200
                Re: Which standard? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-03-26 09:50 +0000
                Re: Which standard? "Peter Knaggs" <pjk@bcs.org.uk> - 2012-03-25 09:18 +0100
                Re: Which standard? "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-03-25 06:07 -0400
                Re: Which standard? Hans Bezemer <the.beez.speaks@gmail.com> - 2012-03-25 22:42 +0200
                Re: Which standard? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-03-26 09:04 +0000
                Re: Which standard? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-03-26 04:39 -0500
                Re: Which standard? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-03-26 22:29 -0700
                Re: Which standard? Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-03-26 18:09 +0000
                Re: Which standard? BruceMcF <agila61@netscape.net> - 2012-03-26 11:37 -0700
                Re: Which standard? "A. K." <akk@nospam.org> - 2012-03-26 20:49 +0200
                Re: Which standard? BruceMcF <agila61@netscape.net> - 2012-03-26 13:22 -0700
                Re: Which standard? Helmar Wodtke <helmwo@gmail.com> - 2012-03-26 11:20 -0700
                Re: Which standard? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-03-27 11:59 +0000
                Re: Which standard? Helmar Wodtke <helmwo@gmail.com> - 2012-03-27 05:26 -0700
                Re: Which standard? "Peter Knaggs" <pjk@bcs.org.uk> - 2012-03-29 00:10 +0100
                Re: Which standard? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-03-29 00:51 -0700
                Re: Which standard? Marc Olschok <nobody@nowhere.invalid> - 2012-03-30 16:13 +0000
                Re: Which standard? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-03-30 13:01 -0500
                Re: Which standard? "Elizabeth D. Rather" <erather@forth.com> - 2012-03-30 09:18 -1000
                Re: Which standard? Alex McDonald <blog@rivadpm.com> - 2012-03-30 14:11 -0700
                Re: Which standard? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-03-31 08:18 -0500
                Re: Which standard? Albert van der Horst <albert@spenarnc.xs4all.nl> - 2012-04-03 09:27 +0000
                Re: Which standard? "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-03-25 05:47 -0400
                Re: Which standard? BruceMcF <agila61@netscape.net> - 2012-03-25 07:49 -0700
              Re: Which standard? BruceMcF <agila61@netscape.net> - 2012-03-24 15:07 -0700
          Re: Which standard? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-03-24 05:44 -0500
      Re: Which standard? Hans Bezemer <the.beez.speaks@gmail.com> - 2012-03-23 19:54 +0100
        Re: Which standard? "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-03-23 21:52 -0400
          Re: Which standard? Hans Bezemer <the.beez.speaks@gmail.com> - 2012-03-24 12:13 +0100
            Re: Which standard? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-03-24 06:24 -0500
              Re: Which standard? Hans Bezemer <the.beez.speaks@gmail.com> - 2012-03-24 13:37 +0100
                Re: Which standard? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-03-24 12:20 -0500
                Re: Which standard? "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2012-03-24 17:24 -0400
        Re: Which standard? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-03-24 14:18 +0000
      Re: Which standard? Hans Bezemer <the.beez.speaks@gmail.com> - 2012-03-23 22:33 +0100
      Re: Which standard? Bernd Paysan <bernd.paysan@gmx.de> - 2012-03-26 03:25 +0200
      Re: Which standard? BruceMcF <agila61@netscape.net> - 2012-03-25 21:40 -0700
    Re: Which standard? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-03-22 04:15 -0500
    Re: Which standard? Fritz Wuehler <fritz@spamexpire-201203.rodent.frell.theremailer.net> - 2012-03-22 13:02 +0100
  Re: Which standard? Helmar Wodtke <helmwo@gmail.com> - 2012-03-25 08:51 -0700
  Re: Which standard? jacko <jackokring@gmail.com> - 2012-03-26 22:14 -0700
    Re: Which standard? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-03-26 23:55 -0700
      Re: Which standard? Helmar Wodtke <helmwo@gmail.com> - 2012-03-27 05:41 -0700
        Re: Which standard? hwfwguy@gmail.com - 2012-03-27 08:45 -0700
        Re: Which standard? Bernd Paysan <bernd.paysan@gmx.de> - 2012-03-28 01:42 +0200
          Re: Which standard? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-03-31 13:46 +0000
        Re: Which standard? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-03-27 22:51 -0700
        Re: Which standard? jacko <jackokring@gmail.com> - 2012-03-27 19:33 -0700

csiph-web