David Arno

Results 87 comments of David Arno

@gafter, OK, that's good to know. I'll carry on with my proposal then, but will take time over it as there's no rush.

As of C# 7.2, the best way I've found so far to model DU's in C# is to use a class hierarchy that uses 7.2's `private protected`. If, in a...

@mcintyre321, Interesting that F# took that approach. I still think building on the NRT flow analysis is a far better way of doing it.

@Richiban, A private constructor does work, but it means all the "case" classes then have to be nested within it. A `private protected` member will achieve a similar result, whilst...

@HaloFour, > You can use `partial` to put them in their own files... Technically, I could do that. But I'd prefer to gouge my own eyes out to be honest.

@Richiban, > Sure, as does an `internal` constructor. Hmm, that's a fair point. I think that in my haste to find a use for `private protected`, I forgot that having...

@jnm2, A type should have one, cohesive, responsibility. If you split that responsibility over multiple files, you are weakening cohesion. For that reason, I dislike the idea of partial classes...

@HaloFour, That's yet another use-case for `match`: ```cs let name = entity match ( case Person person : $"{person.FirstName} {person.LastName}", case Company company : company.FirmName ); ```

>> I believe readonly members would need to be allowed on class types before this could happen. > Not necessarily. The `readonly` member feature is specific to `struct` types. The...

> There is nothing like a readonly object neither in the language nor in the runtime... And there was nothing like a readonly struct before the concept was introduced. Immutable...