Content deleted Content added
AstroFloyd (talk | contribs) m →Python: Fix typos. |
→R: mention "new" shorthand lambda notation |
||
Line 1,486:
===R===
{{details|R (programming language)}}
In R the anonymous functions are defined using the syntax <code>function(argument-list)expression</code> , which has shorthand since version 4.1.0 <code>\</code>, akin to Haskell.
<syntaxhighlight lang="rout">
> f <- function(x)x*x; f(8)
[1] 64
> (function(x,y)x+y)(5,6)
[1] 11
> # Since R 4.1.0
> (\(x,y) x+y)(5, 6)
[1] 11
</syntaxhighlight>
|