ASVIEST
ASVIEST
I think this will be better for pattern matching ```nim case n of BinaryOpr(a: var le, b: UnaryOpr(a: let ri)) if le == ri: le = ... # can write-through...
> @ASVIEST "don't cares" should be written as `_`. I think the syntax without `field:` is preferable as it's shorter and still allows for everything. this may be inconvenient for...
> It's just: > > ```nim > case x > of Sample(let x): > echo x.dataSize > else: discard > ``` > > To select a single field there is...
Maybe you mean this ? ```nim case x of Sample(): echo x.dataSize else: discard ```
> Positional pattern matching should only be allowed for tuple and enumeration types, as these types already have prominent features that rely on the ordering of their fields. In contrast,...
> At least for the tuple variants, how the definition looks would match how the destructuring looks. Most of the time, you don't need the variants as separate objects, so...
The main problem with var parameters here is that the result can be a null pointer dereference; with an out parameter there is no such possibility. The main purpose of...
> However turning it into an `out T` in this case wouldn't help, because the default of a pointer type is the nil pointer, so it's not even safer!. I...
The third way `?=`, devoid of all these problems
I looked at your commits with the `?=` operator and the code doesn't compile due to a (pretty obvious signature mismatch): ```nim template `?=`*[T](self: Option[T], x: untyped): bool # but...