daniel.kl...@cfengine.com wrote:
> Because it is a declarative promise language - which is somewhat different
> than the usual imperative programming language model.  A fine point, but
> different nontheless.  Declarative languages are hard to get your head around
> if you think in purely imperative terms.  Once you "let go" and allow
> yourself to change your mindset, it gets easier :-)
> 
> The promise
>       files:
>           "/etc/passwd"
>               perms => mode("644");
> 
> does not imperatively say "change the mode to 644".  It declaratively
> promises that "the mode will be 644" (which implies that it will be changed
> if it is out-of-spec, but also implies that nothing ill be done if it is
> already as you say it shall be).  This is a simple example - it gets more
> complicated, obviously, when dealing with edit_line promises, or process
> promises, etc, but in all cases, you are declaring "what must be" - and not
> always "how to do it".
> 
> Honestly, I'm not being nit-picky.  Imperative/declarative is a real 
> difference.

But you do that in most languages.  That is, you have some number of library 
routines, perhaps written by others as well as in the core language (perl's 
CPAN 
being the ultimate example) that provide the 'how to do it' and the code you 
write yourself to accomplish a task consists of a list of parameters - and what 
happens (when/how/whether something is done) is left up to the library. 
Cfengine may omit any other way to do things, but it can't change the way 
computers work.

-- 
   Les Mikesell
    lesmikes...@gmail.com


_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to