Newsgroups: comp.lang.forth
Path: utzoo!utgpu!cunews!csi.uottawa.ca!news
From: cbbrowne@csi.uottawa.ca (Christopher Browne (055908))
Subject: Re: HP 48SX uses Forth?
Message-ID: <1991Jun10.170008.13597@csi.uottawa.ca>
Keywords: Forthn
Sender: news@csi.uottawa.ca
Nntp-Posting-Host: prgw
Organization: CSI Dept., University of Ottawa
References: <1991Jun10.142047.20295@mmm.serc.3m.com>
Date: Mon, 10 Jun 91 17:00:08 GMT

In article <1991Jun10.142047.20295@mmm.serc.3m.com> ahhurst.3m.com (Art H. Hurst) writes:
>..... In brief, the system combines elements of Forth and Lisp
>providing a multi-object RPN stack and direct and indirect threaded
>execution, with both atomic and composite objects, temporary (lambda)
>variables, and the ability to pass unevaluated procedures as arguments.
>The objects are similar to Forth words, containing the address of the
>executable code that defines the object and the data that makes up the
>body of the object.

Code Deleted...

>That is the end of the screen on the illustration. Does anyone have any
>info on this? Seems as though Forth is still alive deep within HP.

DEFINITELY Forth is still alive at HP...  They don't CALL it Forth;
they have added features that would make most traditional Forthers
SHUDDER (Floating point?!?!?!  How DARE they! :-)).  The 28 & 48 series
both use (horrors!) an automagic dynamic memory allocation system that's
used for everything from strings to variables to WORDS (functions?)  ALL
of which are dealt with as "objects" that are treated equally.  Parameters
are passed on an explicit stack; that stack does NOT contain integer cells
but rather pointers to objects.

It's NOT the classic  small Forth we know and love - it's Forth with the
(somewhat less tight speed+memory-wise) features of the '90s.  When I
think about the features I'd like to add to my system, I take a look at
my calculator...

Here's a thought;  
In RPL, the IF/THEN/ENDIF thing works as follows:

	IF     code-adding-flag
	THEN
		true-code
	ELSE    (which is optional)
		false-code
	ENDIF

This corresponds to (in traditional Forth)
	code-adding-flag
	IF      true-code
	ELSE    false-code
	THEN

One of my pet peeves is the word THEN; it IS mnemonic, but the useage is
different from the usage of THEN in virtually ALL other computer languages,
and it is different from the typical useage of the word "THEN" in English:

"If I have $50, THEN I will pay the shareware fee"

I wouldn't mind changing the meaning of the FORTH words around to agree with
the way RPL does it;

: new-IF                  ; immediate   \ does NOTHING - just looks good...
: new-THEN [COMPILE] IF   ; immediate \ does what IF used to do...
: new-ELSE [COMPILE] ELSE ; immediate \ No change...  Else DOES do the right
                                      \ thing...
: new-ENDIF [COMPILE] THEN ; immediate

I doubt that the standards committee would be into changing the language
around like this; but it's the way I would code it...  No sense in having
the language use conventions different than everyone else (outside the
Forth world) uses.

I'm open to argument as to where stack arguments should go; BEFORE the IF
or AFTER; in RPL, BOTH places are pretty valid.

-- 
Christopher Browne
cbbrowne@csi.uottawa.ca
University of Ottawa
Master of System Science Program
