Nullablity
P T Withington
ptw at pobox.com
Thu Jun 22 19:21:52 PDT 2006
On 2006-06-22, at 21:15 EDT, Brendan Eich wrote:
> Curl requires initialization for let bindings? (It's hard to tell
> from the online docs I've read.)
It is pretty hard to find anything about Curl on the web.
I may be mis-remembering but I don't think it _requires_ let bindings
to be initialized. You can declare them to have a nullable type or a
type of `any`, in which case I believe they default to `null`.
Curl has two helpful conditional expressions `if-not-null` and `type-
switch`, in the body of these expressions the compiler infers that
variables are of the appropriate narrower type (avoiding the Java
idiom `if (x instanceof Y) { Y y = (Y)x; ...}`).
More information about the Es4-discuss
mailing list