site banner

Small-Scale Question Sunday for January 19, 2025

Do you have a dumb question that you're kind of embarrassed to ask in the main thread? Is there something you're just not sure about?

This is your opportunity to ask questions. No question too simple or too silly.

Culture war topics are accepted, and proposals for a better intro post are appreciated.

1
Jump in the discussion.

No email address required.

Are there any programming languages where spaces can be used to override operator precedence instead (or in addition) of parentheses? E.g. x=1+ ab; // ab evaluates first x=1+a *b; // addition evaulates first

Thanks!

And I thought that how Python uses whitespace was controversial! Are you looking for people with ropes and torches to come to your home?

I haven't seen one. You'd need to write the parser to specifically take notice of whitespace like that and it's so unusual in a programming language that the designer would have needed to be very insistent on it.

Something mathematical like Maple or MatLab might support it. It's basically implementing a math shorthand to avoid parentheses.