[comp.lang.forth] Conditionals

wmb@MITCH.ENG.SUN.COM (02/27/91)

> > A long time ago, I proposed including all the conditionals (< > = <= >= U<
> > U> U<= U>= 0< 0> 0= 0<= 0>=) in ANS Forth, but it didn't pass.

> Anyway, what did you mean with (< (not a rethorical question)?

I was just listing the complete set of conditionals, without regard to
which ones are already in the standard.  In fact, I don't even know which
ones are in the standard and which ones aren't.  I long ago decided to
to include all of the conditionals in my Forth systems , and since then
I haven't bothered to memorize which ones are "standard".

By the way, on a 1's complement or signed magnitude machine, it might be
necessary to have U= and perhaps U0= , because such machines have 2 different
representations for 0.  U= would test for "bitwise identical", and = would
test for arithmetically equal, considering +0 equal to -0 .

Mitch Bradley, wmb@Eng.Sun.COM

NER034@PRIME-A.TEES-POLY.AC.UK (03/08/91)

I do not like the words .IF .ELSE and .THEN, personally I would go for
[IF], [ELSE], and [THEN], although I did put forward a proposal for
/IF( ), /ELSE, /ENDIF, /ELSEIF( ), witch I feal is significantly different
from any existing words.  Also the use of the parenthesis means that you
can define your flag normally.  Ie:

      TRUE CONSTANT DEBUG
      ...
      /IF( DEBUG ) ... /ENDIF


However, I would like to point out that we *DO* teach Forth to two of
our classes.  One of the first words we get them to define is .IF
This simply displays the text True or False.  However it is a vary useful
debugging word and a most logical name (according to the naming conventions).


Peter Knaggs
+-----------------------------+-----------------------------------------------+
! School of Comp. & Maths.,   !    Janet: NER034 @ uk.ac.tees-poly            !
! Teesside Polytechnic,       !   Bitnet: NER034 % tp.ac.uk @ UKACRL          !
! Middlesbrough,              ! Internet: NER034 % tp.ac.uk @ cunyvm.cuny.edu !
! Cleveland, England. TS1 3BA !     Uucp: NER034 % tpoly.ac.uk @ ukc.uucp     !
!-----------------------------+-----------------------------------------------!
! It is not enough to do the right thing; one must also do it the right way.  !
+-----------------------------------------------------------------------------+

wmb@ENG.SUN.COM (03/30/91)

> > custom. This usage of '#' (#IF) doesn't conflict with its traditional one.

> It doesn't conflict with the use of '#' in pictured numeric output?  I
> have to disagree with you here.

It is incorrect to say that pictured numeric output is *the* traditional
use of '#'.  That is just one of the traditional uses.  Another is in
the word #TIB .

The point is that the character '#' has much less traditional "meaning"
in and of itself than '.'

When most Forth programmers see '.' at the beginning of a work, they
think "aha, a printing word".  '#' elicts much less of a response.

> Moreover, I sometimes use my C pre-processor on my Forth code, and this
> would conflict with THAT!

True, but I bet that you represent a very small minority in this respect.
I have been using Forth under Unix for many years, and I don't recall ever
having done this.


In any case, it appears to me that ForthNet seems to have developed a
loose consensus favoring the [IF] names, and the reaction to the question
of whether or not to have the conditional compilation words at all seems
to be leaing toward having them.  I shall present this information to the
ANS committee at the next meeting.

Mitch Bradley, wmb@Eng.Sun.COM