[CMake-Promote] Fwd: Are parenthesis-free calls a Good?

E. Wing ewmailing at gmail.com
Thu Jan 31 19:25:25 EST 2008


I think your concerns are a bit overblown and out of context here.

Parenthesis-free calls are nothing new to Lua and not even unique
among languages. Examples:

Lua:
print "Hello World"

Perl:
print "Hello World"

Python:
print "Hello World"

Ruby:
puts "Hello World"

Tcl:
puts "Hello World"


This particular Lua discussion stemmed from somebody proposed a patch
to support a C-like feature where you can define a string out of
multiple pieces, e.g.

const char* foo = "Hello "
    "World! The weath"
    "er is looking fine to"
    "day.";

The problem with their patch was that it wasn't aware of the existing
rules concerning Parenthesis-free calls and didn't work within this
context. Obviously, the submitter wasn't using this feature and would
much rather have his own feature. Discussion ensues.

Lua has more-or-less had this feature since the beginning (~15 years),
partly stemming from Lua's origins as a description file syntax which
made listing repetitive record entries very convenient. Lua is a very
small, lightweight, and mature language. They don't like to make
changes unless there is a strong compelling reason for it that will
benefit the majority of users.


-Eric


On 1/31/08, Brandon Van Every <bvanevery at gmail.com> wrote:
> I've been lurking on the Lua mailing list.  Seems to be a hotbed of
> people trying out new language syntaxes.  I'm not convinced that's
> beneficial for CMake.  The current discussion is about making
> parentheses unnecessary for function calls.  My input is that having
> parentheses makes it easier for me to parse and metaprogram the code,
> having lotsa different ways to do things makes it harder to
> metaprogram, having different options increases the learning curve and
> documention support burden, and mainstream programmers recognize f(x)
> as a function call.  Against that, other people are saying that
> getting rid of parentheses is friendlier for non-programmers.  Not
> really CMake's concern, in my opinion.
>
> Anyways, in the course of events it was mentioned that someone ditched
> CMake in favor of SCons because of CMake's custom language.
> Marketing-wise, I think there's a fork in the road here that CMake
> needs to address.  Many programmers believe they want a "full
> featured" programming language, and we should deal with the truth or
> falsehood of that perception somehow.
>
>
> Cheers,
> Brandon Van Every
>
>
> ---------- Forwarded message ----------
> From: Alexander Gladysh <agladysh at gmail.com>
> Date: Jan 31, 2008 1:15 PM
> Subject: Re: Are parenthesis-free calls a Good? (was Re: patch:
> C-style string lexing)
> To: Lua list <lua at bazar2.conectiva.com.br>
>
> Brandon wrote:
> > > Or like the sample from Alexander
> > >
> > > foo "name"
> > > {
> > >   bar "bar";
> > >   baz "baz";
> > > }
> >
> > Hrm, to me the bar and baz look like type declarations.
> >
> > I've been lurking around here trying to decide if there's value in
> > using Lua as an embedded language for the CMake cross-platform build
> > tool.  http://www.cmake.org  <...>
>
> As a side note, when some time ago we've considered which
> crossplatform build tool to use for our next project, we've dropped
> CMake due to its "custom" language. We've decided to use SCons then...
> and now we've happily moved to Lua-based premake. :-)
>
> Alexander.
> _______________________________________________
> CMake-Promote mailing list
> CMake-Promote at cmake.org
> http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-promote
>



More information about the CMake-Promote mailing list