Stream: ideas

Topic: allow whitespace for 1-arg functions?


view this post on Zulip Derin Eryilmaz (Mar 25 2025 at 17:23):

Not sure if this has been mentioned before, but what if we allowed whitespace calling only for functions with one argument? (Or methods with the self argument and one other argument). This would also work for tags.

print "Hello"
1.add 2+3

A longer example:

my_list.push Ok encode "Hello"

This would be always parsed as my_list.push(Ok(encode("Hello"))).
Thoughts? I think this would help with there being too much parenthesis sometimes.

view this post on Zulip Anton (Mar 25 2025 at 17:31):

I also don't like too many parenthesis but I dislike exceptions more :big_smile:
Exception in the sense of; calling a function goes like this except when you only have one argument.

view this post on Zulip Richard Feldman (Mar 25 2025 at 17:32):

this is what Ruby does. I had a section in the original proposal talking about that as a possibility, and a consistent piece of feedback was what Anton just said: "let's not complicate the syntax in that way"

view this post on Zulip Joshua Warner (Mar 25 2025 at 19:21):

I think this would bring back a boatload of possible ambiguities about where one expression ends and the next one begins (eg in the context of !-statements in a function)

view this post on Zulip Joshua Warner (Mar 25 2025 at 19:23):

I do like the terseness of it. I also don’t super much like the special-casing. But maybe worth considering in the future, once things have settled down a bit?

view this post on Zulip Richard Feldman (Mar 25 2025 at 20:37):

yeah I'd like to see how things feel once we've actually had a chance to use static dispatch for real :big_smile:

view this post on Zulip Anthony Bullard (Mar 26 2025 at 00:16):

Even Elixir is moving away from it in their official formatter in either 1.18 or 1.19

view this post on Zulip Anthony Bullard (Mar 26 2025 at 00:17):

And I think in many cases in a language like Lua it can hamper readability (outside of require which is almost a keyword)

view this post on Zulip Anthony Bullard (Mar 26 2025 at 00:44):

Actually I’m wrong about Elixir - they are adding () s that were assumed for nullary function calls


Last updated: Jun 16 2026 at 16:19 UTC