This is a fascinating discussion. Of the options that have been proposed so far, I like the metadata: promise type the best, because it avoids any potential conflict of using reserved variable names.
To make the promisers meaningful and to force the metadata to be associated to the current bundle, one possibility would be to make metadata: similar to vars:, something like this: metadata: "author" string => "kermit"; "author_email" string => "ker...@muppetshow.example.com"; "version" string => "42"; "purpose" string => "Make sure Miss Piggy doesn't get angry"; "comment" => "Please don't let her read this!"; One advantage of this is that metadata could potentially be something other than strings, e.g.: "requires" slist => { "cfengine_stdlib", "wp_install" }; "requires_version[cfengine_stdlib]" string => "56.2"; "requires_version[wp_install]" string => "2.3"; Furthermore, in this case I don't think there should be any restriction as to what names can appear in the metadata, so that people could add their own metadata keys, for whatever purposes they want. The question would be how to make these values accessible. One way would be to create a special "sub-scope" in the bundle namespace, e.g.: $(bundlename.metadata.author), but this would again intrude upon the bundle's top-level name space. Another would be to use a new built-in function: bundlemetadata("bundlename", "author"). If this is deemed too complicated, my vote would be for using an array with some particular name, with elements that contain the different pieces of metadata. The BIG advantage of this, as Mark pointed out in his original email, is that it requires no new implementation in the CFEngine language. The other big question is how the metadata should be used? At the simplest level, the metadata is simply there, accessible to promises and tools to do whatever they want. But it could also be considered useful to implement certain checks according to metadata (e.g. inter-bundle dependencies). This could be a whole can of very ugly worms, but it's something to think about. I love that this kind of things are being discussed in this open forum. Best regards, --Diego On Mar 15, 2012, at 10:28 AM, Nick Anderson wrote: > On 03/15/2012 11:01 AM, Brian Bennett wrote: >> Are there already existing reserved local variable names? I don't know >> of any and I'd be resistant to starting this trend just for versioning. >> >> Should this simply be a best practice? In other words, what exactly >> does reserving the word gain us since, as Mark said, no matter how hard >> you try someone somewhere will be using that word (and maybe it's just >> me but I'd prefer to put metadata in an array anyway). > > I think that the metadata will be put to use by some new tools on the > horizon so I think reserving a name would make the most sense. Putting > it in an array seems to me like it would decrease the possibility of > name space conflict and I kind of like how an array would group them > together. > > As I said before personally I still like a metadata promise, but that > would not force the metadata to be tied directly to a bundle, as I > understand how the language works you would be able to define your > metadata in any other bundle unless there was some new restriction put > in place where you couldn't promise metadata types for other bundles. I > agree with Mark that doing anything like that would break the integrity > of the language. > > -- > Nick Anderson <n...@cmdln.org> > _______________________________________________ > Help-cfengine mailing list > Help-cfengine@cfengine.org > https://cfengine.org/mailman/listinfo/help-cfengine _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine