On 17/07/11 09:06, Erlend Leganger wrote:
> On 17 July 2011 07:35, Aleksey Tsalolikhin <[email protected]
> <mailto:[email protected]>> wrote:
>
> On Fri, Jul 15, 2011 at 12:44 AM, Mark Burgess <[email protected]
> <mailto:[email protected]>> wrote:
> > ... there is no
> > difference in the way that () and {} are handled. Logically, there
> > should be full symmetry between these cases.
>
> Dear Mark,
>
> If () and {} have no difference, why are there two of them, please?
>
> Why not just () or {}? What's the use of having them both, please?
>
> Legacy? I see that the $(varname) construct is preferred in the docs, I
> certainly prefer ${varname}, because this is consistent across Perl,
> Bash and then Cfengine.
I think they are quite complimentary - I prefer $(varname) as it is
consistent to Makefile usage, and much easier to type on my French
keyboard (getting a { or a } requires weird keystrokes).
Also, in complex variable expansion situations, I have found alternating
the two can lead to clearer code, such as
$(arrayname[${arraykey}]).
Jonathan
--
--------------------------------------------------------------
Jonathan Clarke - [email protected]
--------------------------------------------------------------
Ldap Synchronization Connector (LSC) - http://lsc-project.org
--------------------------------------------------------------
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine