On Mon, 8 Apr 2019 01:17:18 -0700 (PDT), Arnaud Amiel <
[email protected]> wrote:
I used to be good at this but this was many years ago.
I have now dusted off my emulator and try to do the thing below.
It is not optimised in any way and doesn't work.
It looks like the NULLLAMs are not available inside the DO loop. There is something in the back of my mind that tells me "you should know why" but it has been a good 10? years.
Any pointers appreciated
Arnaud
!NO CODE
!RPL
::
DUPDUP
%%*
%%1
%%+
%%2
%%/
3UNROLL
%%1
%%+
%%2
%%/
%%1
%%1
4NULLLAM{}
BIND
DO
1GETLAM
4GETLAM
%%-
%%2
%%/
DUP
2GETLAM
%%*
%%*
%%-
1GETLAM
4GETLAM
%%*
%%SQRT
4PUTLAM
2GETLAM
%%2
%%*
2PUTLAM
3GETLAM
DUPDUP
1PUTLAM
4GETLAM
%%+
%%2
%%/
DUP
3PUTLAM
%%-
%%0=
UNTIL
1GETABND
%%/
;
@
It looks like you've mixed up a DO .. LOOP with a BEGIN .. UNTIL loop :) Replacing "DO" with "BEGIN" should fix the problem :). BEGIN and UNTIL are RPL words that can stand on their own, although I've come across very few examples where one would need that -- they're usually paired :) .
I'm surprised that the compiler didn't issue an error or a warning :)
Regards,
Hic quondam locutus sum
--------------------------------------------------------------------------------
Send e-mails to "NOhp48 Sat Palephnaught Adot Morg"
( Remove the capitalized letters spelling "NOSPAM" )
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)