cfengine-develop
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Cfengine-develop] Re: Homework


From: Andrew Stribblehill
Subject: Re: [Cfengine-develop] Re: Homework
Date: Tue, 4 Mar 2003 10:13:53 +0000
User-agent: Mutt/1.5.3i

Quoting Andrews, Martin <address@hidden> (2003-03-04 04:34:29 GMT):
> It is all academic since I am generating my cfengine files now, but I found
> the perlisms noisy. Maybe since our audience is sysadmins and they are
> mostly fluent in perl it is okay, but it is adding a lot of punctuation.
> Maybe because of my recent efforts with pythin I was thinking that you would
> define a list with something like:
> 
> control:
>   myvals = [ a, b, c ]
> 
> And still reference it as plain
> 
> shellcommands:
>   "echo $(myvals)"

I like this too. By extension, associative arrays could be,

control:
  case_colour = { "linux" => "grey",  "sgi" => "purple" }

Then something to say that the former was to be treated as a class.

That said, I'm not sure we actually need associative arrays (or dicts
or hashes, whatever you call them) in Cfengine, since for my example,
the following already works:

control:
  linux::
    case_colour = ( grey )
  sgi::
    case_colour = ( purple )

But that's quite a bit more wordy than the former example. How about
this:

control:
  case_colour = Case(linux:: "grey", sgi:: "purple", any:: "invisible")

Now I see I shouldn't have chosen the example of the colour of a case
to showcase a 'case' statement :)

-- 
WEST FITZROY
SOUTHWEST VEERING WEST OR NORTHWEST 5 TO 7, DECREASING 3 OR 4
LATER. RAIN THEN SHOWERS. MODERATE OR POOR BECOMING GOOD




reply via email to

[Prev in Thread] Current Thread [Next in Thread]