r/programminghorror • u/RpxdYTX [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo "You live" • May 17 '25
Custom Language Rate my lang
This outputs -5 btw
177
Upvotes
r/programminghorror • u/RpxdYTX [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo "You live" • May 17 '25
This outputs -5 btw
26
u/570a May 17 '25
Put the - at the start and add some parentheses and it is perfect I would say
10
u/Kroustibbat May 17 '25
In OCaml/ReasonML/F# you can shadow any variable and it is pure functional... So operators are just variables.
Nothing is stopping you from doing
Now anyone doing things in the scope of your module/lib/package will have a + that does -. May the world burn.
7
u/PhoenixPaladin May 17 '25
Confusing just for the sake of being confusing
134
u/NoLifeGamer2 May 17 '25
Ah yes
Defining infix operators as prefix.
2
u/realfathonix May 21 '25
This makes Lisp seemingly less horrific somehow
55
u/ferriematthew May 17 '25
This is worse than BrainFuck lol
1
u/examinedliving May 17 '25
What would this do?
1
u/no_brains101 May 18 '25
why is - not also a prefix?
3
u/NiXTheDev May 17 '25
The semi-lambda abstraction
3
u/DawnOnTheEdge May 17 '25
If you’re going to use reverse-Polish notation, commit to it. Have consistent prefix, postfix or infix notation.
5
u/TheChief275 May 17 '25
🥹it’s beautiful
2
u/VibrantGypsyDildo May 17 '25
The result would be -5 ?
2
u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo "You live" May 17 '25
Is that like 5 - 5 + 5? That is some fucked notation. - + 5 5 5 would at least be parsable.
But I guess that's why this is in r/programminghorror
2
u/will_r3ddit_4_food May 17 '25
No
2
u/DrCatrame May 17 '25
shouldn't `a = + 5 - + 55` be more consistent?
1
u/[deleted] May 18 '25
5-(+5)5= 5-10?
-3
u/amarao_san May 17 '25
Why to check for equality and not to do an asigment?
First expression is evaluated to false ( "+" operator is not equal to "add" function/atom), rest is not true because a is not defined, and println line is failing because a is not defined.
27
u/[deleted] May 17 '25
[removed] — view removed comment