Les-

I think you may have missed my core point.  The issue is not library versus
you, or anything like that.  A declarative language says "what will be", and
does not change what already satisfies that.  Additionally, getting to the
stage of "what you want" may take a few cycles.

Just looking at the mode, if you just set the mode, you change the mtime on
the file.  If the mode is what you want, don't touch it.  Mode is a *SIMPLE*
example, but looking deeper, you don't say "if this is there, do that, but if
that is there, do this".  You just state what your desired end-state is.

It is a fine point, but an essential one - and perhaps I am not explaining it
as well as I could...  You are correct, cfening does not change the way that
computers work.  It changes the way that *you* work with them.

-Dan

> 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 arou
> nd
> > 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 differ
> ence.
> 
> 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 C
> PAN 
> 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 wh
> at 
> 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