Using #Algebraic #Datatype #PatternMatching in #java into dataseries library (backported from rust implementation) : https://www.javadoc.io/doc/io.github.cboudereau.dataseries/dataseries/latest/io/github/cboudereau/dataseries/package-summary.html
#algebraic #datatype #PatternMatching #java
"Unlock the Magic of Pattern Matching in Dart 3.0" https://mokshmahajan.hashnode.dev/unlock-the-magic-of-pattern-matching-in-dart-30 #dart #patternmatching
"Unlock the Magic of Pattern Matching in Dart 3.0" https://mokshmahajan.hashnode.dev/unlock-the-magic-of-pattern-matching-in-dart-30 #dart #patternmatching
On today's "Adventures in pattern matching with C#":
Replacing 19 lines of nested if's with this:
return device switch
{
null => Assignability.UnknownDevice,
{ AccountNumber: null } => Assignability.Assignable,
_ => device.AccountNumber!.Value == accountNumber ? Assignability.AlreadyAssigned : Assignability.AssignedToOtherAccount
};
#PatternMatching #csharp #dotnet
@AstraKernel @lx Well, I guess the prompt was something like "Produce a buffer overflow in Rust".
As #AI's are just stupid statistical models, they think: Hey, I've seen _many_ buffer overflow examples in C and "buffer overflow" mentioned with C, so let's convert that to Rust - et voilá.
It doesn't _understand_ that Rust is a safe language.
We should not expect reasoning or intelligence from an AI.
It is pattern matching, nothing more.
#noreasoning #PatternMatching #ArtificialIntelligence #AI
"Continually extending #PatternMatching w/ new "features" is frankly a trap in programming language design that stems right back to the 1970s & 80s when pattern matching was first introduced... Why?"
https://github.com/fsharp/fslang-suggestions/issues/968#issuecomment-764636595