Which reserved keyword in the F# language spec should be implemented in vNext?
Now the FSharp v1 has gone into Beta it's time to ask about vNext.
The FSharp language spec defines the following reserved keywords:
atomic break checked component const constraint constructor
continue eager fixed fori functor include
method mixin object parallel params process protected pure
sealed tailcall trait virtual volatile
which of these would you like to see 开发者_如何学Cimplemented and why?
One keyword per answer please.
trait, assuming trait is something like Scala traits.
My vote is for tailcall.
If I understand the intention correctly this would be a keyword to mark recursive functions the author would intend to be tail recursive. If for whatever reason the compiler cannot comply, a diagnostic message can be of great help.
As it stands now if you fail to structure your recursive function properly the first time you will be informed about this is the StackOverflow exception (No pan intended)
I'm somehow not able to follow your link, but in case atomic
applies to builtin software transactional memory, this is my favorite.
Good question but hard to answer. You can't guess exactly the purpose of each reserved keyword, right?
From my perspective, I could see some useful use cases for fixed
(fixed size buffers).
I'd vote for eager
, if it meant that evaluation was lazy by default (like in Haskell, but unlike current F#).
精彩评论