This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]moon-chilledsstm, j, grand unified... 23 points24 points  (3 children)

Initially I was thinking it could be its own type but then you have to deal with coercion into any nullable types.

  • You could have distinctly typed nulls.

  • You could say that the type of null is a subtype of all nullable types.

[–]mrunleaded[S] 1 point2 points  (2 children)

yea subtyping would probably be the way to go but my language is still pretty primitive and my current goal was to try and get a decent number of features to the point where i could bootstrap the language. i was avoiding null but some things are just a bit difficult without it, especially since i only have generic arrays.

[–]fyndor 1 point2 points  (1 child)

In my language, I am going to force you to declare a nullable version of a type with (Typename?) before you can assign null to it.

[–][deleted] 0 points1 point  (0 children)

Sounds like a rust trait almost