[RPL/2] library in interactive mode

BERTRAND Joël joel.bertrand at systella.fr
Mar 28 Sep 20:40:54 CEST 2004


DEMAINE Benoit-Pierre a écrit :
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> 
> | Moreover, I found a difference between the behavior of "rpl -i" and
> | the behavior of a HP28S calculator: variables which contain programs
> | are not spontaneously evalued.
> 
> I am used of HP48G(x) and it acts the same way as HP28S ...
> 
> this is because the default action is to evaluate variable ( and thus
> their content ), by jumping to the address of their content ( the
> identifier of all content is in fact the ASM adress of the routine which
> can manipulate them, and the manipulation for program is to be run ... )

	In RPL/2, the difference comes from the two execution modes 
(interactive mode and script mode).

> Since RPL/2 do not run ASM directly, I expect Joel not to be aware of
> that, and to push content on the stack for all content without checking
> the type of content ...

	Sequenceur.c subroutine tests the type of content. But if you want to 
push in the stack a RPN expression, for example

TEST
<<
	<< X sin >>
	steq draw
 >>

you cannot execute << X sin >>. In a second time, you can write

TEST_2
<<
	<< X sin >> 'A' sto
	A steq draw
 >>

and you can ask why A is not executed. In both cases, the operations on 
the stack are the same and if you authorize the evaluation of A in the 
second case, you have to authorize the evaluation of << X sin >> in the 
first case...

> I did not read source of RPL/2, but the bug you mention makes sense to me.

	It's not really a bug. I will check if it is possible to find a 
reasonable workaround.

> as you say, RPL/2 remains a very good tool - but full compatibility with
> HP calculators would de a plus ^^

	The goal of RPL/2 is not to write an emulator, but a real scientific 
language. I have started from scratch the fourth release because I have 
some troubles with matlab (precision of the computations). RPL/2 can 
handle integers (64 bits), real (64 bits) and complexes (128 bits) and 
all computations are made with the best precision available on the 
workstation (for example, in a multiplication of matrices, all elements 
are sorted before start any addition). RPL/2 is a modified 28S-RPL with 
some extensions, and sometimes, a total compatibility cannot be assure 
between the regular 28S and this tool.

	Regards,

	JKB



Plus d'informations sur la liste de diffusion RPL2