This shows you the differences between two versions of the page.
lambdas_anonymous_functions [2022/03/19 13:43] richardrussell created |
lambdas_anonymous_functions [2022/03/19 20:44] (current) richardrussell Changed to illustrate passing two parameters |
||
---|---|---|---|
Line 2: | Line 2: | ||
//by Richard Russell, March 2022// | //by Richard Russell, March 2022// | ||
- | BBC BASIC does not ' | + | BBC BASIC does not ' |
Here is an example (it relies on extensions available in //BBC BASIC for Windows//, //BBC BASIC for SDL 2.0// and the //Console Mode editions// | Here is an example (it relies on extensions available in //BBC BASIC for Windows//, //BBC BASIC for SDL 2.0// and the //Console Mode editions// | ||
Line 8: | Line 8: | ||
<code bb4w> | <code bb4w> | ||
PROC_lambda(foo{}, | PROC_lambda(foo{}, | ||
- | PROC_lambda(bar{}, | + | PROC_lambda(bar{}, |
PRINT FN(foo{})(5) | PRINT FN(foo{})(5) | ||
- | PROC(bar{})(PI) | + | PROC(bar{})(PI, 2) |
END | END | ||