idl 8.4 引入了该lambda
功能。我有 IDL 8.6.1,并且该lambda
功能无法按文档说明完全工作:
IDL> f = lambda(x : x * x)
IDL> print, call_function(f, findgen(10))
0.00000 1.00000 4.00000 9.00000 16.0000 25.0000 36.0000 49.0000 64.0000
81.0000
IDL> print, f(findgen(10))
IDL$LAMBDAF5 IDL$LAMBDAF5 IDL$LAMBDAF5 IDL$LAMBDAF5 IDL$LAMBDAF5 IDL$LAMBDAF5 IDL$LAMBDAF5 IDL$LAMBDAF5 IDL$LAMBDAF5
IDL$LAMBDAF5
IDL> print, f(5)
% Attempt to subscript F with <INT ( 5)> is out of range.
那么,为什么f(5)
不返回25
呢?