Forum: Cfengine Help Subject: Re: Force variables to be defined after classes? Author: Seva Gluschenko Link to topic: https://cfengine.com/forum/read.php?3,18656,18675#msg-18675
Well, let's try to guess some usecases. Looking through promises I've written already, I can define following cases: [*] a class is defined based on isvariable() call result. It is used further in files etc, not in variables. [*] a class is defined based on fileexists() call result which uses locally defined variables to construct a pathname. [*] a class is defined based on regline or strcmp for a variable passed to a bundle as the argument, e.g. edit_line("add", "foo"). [*] a variable is defined based on previously defined (global) class(es). [*] a variable is defined based on locally defined class(es). As one can see from this (perhaps, incomplete) list of cases, just one case preferes current ordering and just another one prefers reverse ordering, other cases don't feel the difference. Next, I've looked through 48 files which contain my current promises collection. I must confess, I was wrong stating that I'm going to agree with Jesse. I never use variables definition based on local classes, but there is plenty of bundles which use classes definition based on local variables. I remember, once I wanted the reverse ordering for something, but in a mean time I'd found another way to achieve my goals. So Jesse, be a pal and tell us what you're trying to do. Perhaps, there's a much simpler way to achieve your goals. _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine