现在我断定方法叫做: 代码: def MyClass
def send_report
...
Net::SFTP.start(@host, @username, :password => @password) do |sftp|
...
end
...
end
end
测试: it 'successfully sends
我想获得函数f(i)值的总和,当i等于a到b时,f(i)+ f(a + 1)+ ... + f(b-1)+ f(b) 所以我写了这样的代码。 let rec sigma : (int -> int) -> int -> int -> int
= fun f a b ->
if a=b then f a
else f b + sigma f a b-1 ;;
但结果是在评估期间存在堆栈溢出