Re:Why F#?
by hoseja on Wednesday April 02, 2025 @06:32AM
(#43555330)
weak typing: 2 + "2" is 22
[ Parent
| on HN ]
Re:Why F#?
by RUnconcerned on Wednesday April 02, 2025 @09:41AM
(#43556571)
could also be "4" or 4! 4 seems like it would be the most evil option, honestly
The real evil option is C: 2+"22" = 0, 4+"4" = undefined behavior and probably the value of some other variable.
The real horror is "1d9" + 1 = 2, as does PHP: https://3v4l.org/Dn6Sm
I think you meant: "22"+2 = "", and it is not UB to make the second pointer, only to use it
The pointer arithmetic works both ways, same as square brackets.