如何測試是否提供可選參數? - 在VB6/VBA Function func (Optional ByRef arg As Variant = Nothing)
If arg Is Nothing Then <----- run-time error 424 "object required"
MsgBox "NOT SENT"
End If
End Func
我想要一個List.map的尾遞歸版本,所以我寫了我自己的。那就是: let rec list_map f l ?(accum=[])=
match l with
head :: tail -> list_map f tail ~accum:(head :: accum)
| [] -> accum;;
每當我編譯這個功能,我得到: File "main.ml"