Open Parentheses Continue Lines

As an alternative to the controversial SemiColons, some languages use parentheses to decide to look on the next line. In other words, a command is assumed to only span one line unless a parenthesis is open. Rather than something like an underscore in VB, one just puts parentheses around expressions if they are not already open.

This example is "self continuing" because the function parameters keep it open:

  foo(aaaaaaaaaaaaaa, bbbbbbbbbbbbbb, ccccccc=blaaaah, 
      dddddd=gruuuuug)
This example requires parentheses to force the parser to look on the next line(s):

  x = (aaaaaaaaaaaaaaaa + bbbbbbbbbbb + CCCCCCCCCC
      + DDDDDDDDD)

Examples: PythonLanguage


CategorySyntax


EditText of this page (last edited November 29, 2011) or FindPage with title or text search