[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Syntax errors with the "space-before-paren" style in Ruby and SWIG

From: David James <djames_at_collab.net>
Date: 2006-02-03 20:34:29 CET

In Ruby, if you put a space before an argument parenthesis, the
compiler emits a warning:
  "warning: don't put space before argument parentheses"

This warning isn't just a style suggestion. If you put spaces before
parentheses, the Ruby parser can choke. For example:
  out << "some string".gsub (/[\s\n]*$/, "")

Perhaps we should follow the advice of the Ruby compiler, and avoid
the "space-before-paren" style? Ruby isn't the only language which has
trouble with the spaces. SWIG and the C-preprocessor have issues too.

If we use the "no-space-before-paren" style, we'll be able to have
consistent function-call style throughout our entire body of source
code, including the SWIG bindings. That'd be a great thing.

Cheers,

David

--
David James -- http://www.cs.toronto.edu/~james
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Feb 3 20:37:23 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.