Skip to content
Prev 52520 / 63421 Next

anonymous function parsing bug?

Hi,

sry for the double posting. I forgot to mention that this example

###
f<-function(x) {
     return( 2*x )
}(2)

class(f)

f(3)

f<-function(x) {
     return( 2*x )
}(4)(5)

f(6)
###

leads to

##
 > f<-function(x) {
+     return( 2*x )
+ }(2)
 >
 > class(f)
[1] "function"
 >
 > f(3)
[1] 6
 >
 > f<-function(x) {
+     return( 2*x )
+ }(4)(5)
 >
 > f(6)
[1] 12
##

which is even stranger (at least for me) and contradicts the first 
listing imho in behaviour.

Best wishes,

Wilm

Am 21.10.2016 um 15:10 schrieb Wilm Schumacher: