# Syntax "surprise"

**URL:** <https://rubytalk.org/t/syntax-surprise/853>\
**Category:** ruby-talk\
**Created:** [25 July 2002 19:52 UTC](https://rubytalk.org/t/syntax-surprise/853 "2002-07-25T19:52:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marcin\_Qrczak\_Kowalc](https://avatars.discourse-cdn.com/v4/letter/m/2bfe46/32.png) [@Marcin\_Qrczak\_Kowalc](https://rubytalk.org/u/Marcin_Qrczak_Kowalc)\
**Post date:** [25 July 2002 19:52 UTC](https://rubytalk.org/t/syntax-surprise/853/1 "2002-07-25T19:52:58Z")

</div>

Thu, 25 Jul 2002 01:15:23 +0900, David Alan Black [dblack@candle.superlink.net](mailto:dblack@candle.superlink.net) pisze:

> I suspect that a Ruby-like language without commas separating method  
> arguments would end up with an awful lot of parentheses instead.

Indeed it implies more parentheses. I was experimenting with two  
approaches to mixing space-separated and comma-separates argument  
lists:

1. The basic syntax is “function arg1 arg2 arg3” and additionally  
“,” means “) (”. So you can write either of these:  
func x y (g 3)  
func(x, y, g 3)  
func x (y, g 3)

2. The basic syntax is “function arg1 arg2 arg2”. Expressions may  
return any number of results and they are interpolated into argument  
lists. “expr1, expr2” means to concatenate results of expressions.  
So the above are valid as well and have the same meaning.

So you can’t write commas without parentheses, but you never need to  
parenthesize atomic expressions, commas can be avoided completely if  
you like, and you can also consistently use the syntax “f(x, y, z)”  
with usual precedence.

> **···**
>
> –  
> \_\_("\< Marcin Kowalczyk  
> \_\_/ qrczak@knm.org.pl  
> ^^ [Blog człowieka poczciwego.](http://qrnik.knm.org.pl/~qrczak/)
