News for hackers. Stuff that matters.
Re:Why F#? by hoseja on Wednesday April 02, 2025 @06:32AM (#43555330)
weak typing: 2 + "2" is 22
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
Re:Why F#? by pjc50 on Wednesday April 02, 2025 @09:46AM (#43556640)
The real evil option is C: 2+"22" = 0, 4+"4" = undefined behavior and probably the value of some other variable.
Re:Why F#? by sehansen on Wednesday April 02, 2025 @10:30AM (#43557104)
The real horror is "1d9" + 1 = 2, as does PHP: https://3v4l.org/Dn6Sm
Re:Why F#? by manwe150 on Wednesday April 02, 2025 @10:16AM (#43556952)
I think you meant: "22"+2 = "", and it is not UB to make the second pointer, only to use it
Re:Why F#? by hoseja on Tuesday April 08, 2025 @04:08AM (#43619422)
The pointer arithmetic works both ways, same as square brackets.
Re:Why F#? by baq on Wednesday April 02, 2025 @12:48PM (#43558658)
or the most sane, depending on context... e.g. awk and perl do this.