[RPL/2] self compiling ?

BERTRAND Joël joel.bertrand at systella.fr
Mer 5 Déc 12:03:53 CET 2007


Adrian Blake wrote:
> Please,
> 
> An example of exsub .
> 
> 
> HELP> exsub
> 
>    EXSUB (expression substitution)
> 
>      4: << RPN >>
>      3: integer
>      2: integer
>      1: { list }
> ->  1: << RPN >>
> 
> Insert objects in list in RPN expression at position ??? ( first integer ) ??

	4: expression you will modify
	3: first object that will be replaced ('<<' and '>>' are functions)
	2: last object that will be replaced
	1: list that contains new objects

For example:
4: << 1 2 3 >>
3: 2
2: 3
1: { 5
      +
      4
      * }
RPL/2> exsub

1: << 5 + 4 * 3 >>

First object (2): << _1_ 2 3 >>
Last object (3): << 1 _2_ 3 >>

EXSUB replaces << _1 2_ 3 >> by 5 + 4 *. Thus, you obtain:
<< 5 + 4 * 3 >>

Please note that << 1 2 3 >> contains 5 objects ('<<', 1, 2, 3, '>>') 
and that << << 1 2 3 >> >> only contains 3 objects ('<<', '<< 1 2 3 >>', 
'>>').

	Regards,

	JKB


Plus d'informations sur la liste de diffusion RPL2