Skip to content

Commit 2b458d1

Browse files
committed
doc: Confirm that map works recursively
The `map` function on the HP48 is supposed to be recursive. Document that fact. Related to #1649 Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
1 parent 9b84ec4 commit 2b458d1

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

doc/commands/lists.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ first level of the stack should take one argument and return a single value.
4646

4747
`{ A B ... }` `F``{ F(A) F(B) ... }`
4848

49+
The operation applies recursively to inner lists.
50+
51+
```rpl
52+
{ 1 2 { 3 4 } } « →STR » MAP
53+
@ Expecting { "1" "2" { "3" "4" } }
54+
55+
```
56+
4957
## Reduce
5058

5159
Apply a cumulative pairwise operation on all elements in a list or array.

help/db48x.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12559,6 +12559,14 @@ first level of the stack should take one argument and return a single value.
1255912559

1256012560
`{ A B ... }` `F` ▶ `{ F(A) F(B) ... }`
1256112561

12562+
The operation applies recursively to inner lists.
12563+
12564+
```rpl
12565+
{ 1 2 { 3 4 } } « →STR » MAP
12566+
@ Expecting { "1" "2" { "3" "4" } }
12567+
12568+
```
12569+
1256212570
## Reduce
1256312571

1256412572
Apply a cumulative pairwise operation on all elements in a list or array.

help/db50x.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12567,6 +12567,14 @@ first level of the stack should take one argument and return a single value.
1256712567

1256812568
`{ A B ... }` `F` ▶ `{ F(A) F(B) ... }`
1256912569

12570+
The operation applies recursively to inner lists.
12571+
12572+
```rpl
12573+
{ 1 2 { 3 4 } } « →STR » MAP
12574+
@ Expecting { "1" "2" { "3" "4" } }
12575+
12576+
```
12577+
1257012578
## Reduce
1257112579

1257212580
Apply a cumulative pairwise operation on all elements in a list or array.

0 commit comments

Comments
 (0)