Re: Nested functions - better example?
- Posted by _tom (admin) Jan 11, 2021
- 913 views
I got lost in your Rosetta example "Nested Function"
How about:
function makeList( sequence item, string separator=". " ) function makeItem( integer count, string separator, string element ) return sprintf( "%d%s%s", {count,separator,element} ) end function for i=1 to length(item) do item[i] = makeItem( i, separator, item[i] ) end for return item end function ? makeList( {"first","second","third"} ) --> {"1. first","2. second","3. third"}
Used stuff like this in Pascal in the olden days.
be well
_tom