You're viewing a single thread.
All Comments
127 comments
Caveman @lemmy.world I'd take a
not
or "if not" operator tbh.26 0 ReplyLmaydev @programming.dev It has a not keyword it's used for pattern matching.
if (x is not null)
9 0 ReplyCaveman @lemmy.world It also has a
!=
.3 0 ReplyLmaydev @programming.dev Pattern matching is different.
2 0 ReplyCaveman @lemmy.world Yeah, I just said it since you used it with null. I used it a lot for enums
2 0 ReplyLmaydev @programming.dev The type matching is the most common thing I use it with. Combined with inline variables.
if (x is string { Length: 5} s) { // do stuff with s }
And switch expressions.
As a side note inline variables are amazing haha
1 0 Reply
Patches @sh.itjust.works Stuff can be two things
2 0 Reply
Appoxo @lemmy.dbzer0.com
ifnt instead of ifn't
3 0 Reply
127 comments
Scroll to top