Function definition: Difference between revisions

(PascalABC.NET)
Line 2,223:
map times3, [1, 2, 3]</syntaxhighlight>
 
=== impure functions (I/O)effects ===
ImpureFunctions functionswith impure effects must be declared as such, using fn*.
<syntaxhighlight>val writeit = impure fn(x) { writeln x }</syntaxhighlight>
val writeit = fn*(x) { writeln x }
</syntaxhighlight>
 
Impure functions cannot be passed to pure functions.
1,007

edits