can your language do this?
Can your language do this?
if (x) {
x->foo();
}
x = y? y : 2;
if(!x) x = y;
x :: Maybe a
x = y z
f :: (a -> b) -> Maybe a -> Maybe b
f = fmap
what is this lang called?
based C:
x = y?y:z;
C-hashtag
>2019
>nullable types LMAO
I love when even my programs don't know what to expect.
unreadable shit desu
std::optional y;
x = y.value_or(x);
ya, but can your Lang do this?
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
is using nulls like that encouraged
we found the lisp fag !
x = y | z;
let x = match y { Some(s) => s, None => z };
let y = 32;
let mut x: Option = None;
if let None = x { x = Some(y) };
if let Some(s) = x { foo() };
Lurk more.
this is javascript
x?x=y:x=x
>>> x = None
>>> y = None
>>> z = 'wut'
>>> x = y if y else z
>>> x
'wut'
>>> x = x if x else y
>>> x
'wut'
>>> if x: print('foo')
...
foo
>>>
x = y ? y : z
wut
t. brainlet that can't understand python
var(Y) -> X = Y ; X = Z.
var(X) -> X = Y.
\+ var(X) -> call(foo).
>Jow Forums thinks only meme languages have cool features
>Jow Forums forgets about javascript
my sides
I don't use anti-semitic languages.
Why would you ever need that? Doesn't seem stable or legible.
yes, my language has phi expression
yes, but faster.
x ? x = y : 0;
I use C++ and do whatever the fuck I want is 1/100th of the time bitch
potential to create broken programs? every language has this but I don't think it is a cool functionality
x = y || z; # assign y to x if y is not null, otherwise evaluate z
x = y && z; # assign z to x, but only if y is not null, otherwise assign null
yep
>you literally can't get npe in haskell
holy shit, what a based language
bow to your master, peasant
++++++++++[>+>+++>+++++++>++++++++++++.+++++++++++++++.------------------.++++++++.+++.-----.--..--.+++++++++++++.+.
Are these branchless ? If not, fucking kill yourself faggot.
What do you mean by "branchless"? Isn't it super useful if the right hand side isn't evaluated if the left hand side isn't null?
>needing a PhD in math to write babby's first code in your language
Last one seems like a sure way to shoot yourself in the foot.
If y is not null:
X=y
Else:
X=z
If x is null:
X=y
If x:
X.foo()
Seems pretty pointless to build this into a language but maybe nice to have if you're a line reducing babby
>being an actual retard
>be wagecuck
>write less compact code to get paid the same for doing less work
>having to avoid useful syntactic sugar so your diversity hire coworkers can understand it
>not using all features of your language
incredibly high iq post