I don't see why pattern matching is necessary for version 1.0. Can you explain
the rationale for it?
> To start with a practical example, ...
Syntactic issues aside, you start with an example that cannot be checked for
exhaustiveness and so is pretty much against the idea of `case`.
The reason why pattern matching needs to be built into the language is not
convenience (you can get that with a
> `T?`
The syntax for type constructions follows Nim's syntax for expression
construction and in expressions there are no postfix operators so `T?` doesn't
fit Nim's syntactic framework. In other words I decided against this as this
syntax is hard to implement and inconsistent.
> nil ref T.
Super. I think this change will turn some heads. I also like the recent work on
region collection. Rust and Swift are going all in on doing away with the
tracing GC; it's a good thing that Nim can hedge it's bets.
> > ML/Rust style pattern matching?
>
> Oh we might as well start a
> That's great. What's the syntax for declaring possibly nil types?
>
> nil ref T.
[Optional Types](https://en.wikipedia.org/wiki/Option_type) suggests another
alternative of
`T?`
so
var
v1: int # not nil
v2: int? # can be nil
proc xyz[T?](): T?
To start with a practical example, I would like to talk about, how I would
pattern match the NimNode types, mostly because they are types I would care
about. The syntax should be almost identical to the construction, just it
should work in reverse. Here is an example of how I could imagine it:
> That's great. What's the syntax for declaring possibly nil types?
`nil ref T`.
> ML/Rust style pattern matching?
Oh we might as well start a discussion here about its syntax. I thought it
would be just
case x.kind
of enumValue(a, b, c): ...
...
> I hope that whiche
> version 1.0 battle plan
>
> ===
>
> \- make 'not nil' the default (produce warnings instead of errors for a
> smooth migration path)
That's great. What's the syntax for declaring possibly nil types?
> \- case objects needs to be safe and need to support pattern matching