3 ms·
i am not for sure what you mean by "original name". the value of each of those function definitions are: val test1 : x:int -> int val test2 : x:int -> int
by nikofeyn 8y ago
i am not for sure what you mean by "original name". the value of each of those function definitions are:
val test1 : x:int -> int
val test2 : x:int -> int
you call them the same way, and they have the same type. a caller has no knowledge of how they were defined because it isn't important. they're identical.
- yorwba 8y ago> they're identical. Does that mean that test1 == test2 will return true? Personally, I have found it very useful for debugging that function objects in Python carry their name. That makes it much easier to find out where something is coming from.
- jjnoakes 8y agoI mean in python, one can ask a function what it was originally defined as. Sounds like in F# one can not, so that's why there's a difference in python between "var x = lambda..." and "def y(): ..."; the latter knows it is named "y" and the former has no idea what its name is (so it is "lambda").