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

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

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2006-02-03 22:03:17 CET

David James wrote:
> 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]*$/, "")

Sorry, you'll have to explain if you want that "example" to demonstrate
anything to those of us not familiar with Ruby syntax.

> 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.

Tell us about SWIG's issues (briefly).

As for the C preprocessor, I believe the only issue is that the definition of a
macro taking parameters can't have a space before the open parenthesis; we
already know and accept that so it's not an issue that causes any problems. Am
I wrong?

> 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.

That extra bit of consistency would be no bad thing, but hardly "great", I think.

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Feb 3 22:04:08 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.