On 2014-12-08 22:02, Spencer Krum wrote:
1) I really don't want to see variable expansion in
expressions that
resolve to the names of types. This will be misused, it
will make code
unreadable. Please leave it out. Sets of parameters only
make sense to
distinct types anyways, if two types really do accept all
the same
parameters, then the RAL should be leveraged and different
providers
written.
It is already used (via create_resources), and people want it to support
integration use cases between more tightly coupled modules.
The fact that only four modules use it is, to me, exactly validation
that it’s a rare enough use case that it should be left to things
like functions.
The language should be optimized for the most common use cases, not
the complete list of them.
I think Luke has nailed it. Only in the rarest circumstances will this
be used to make the code better, and thats not something that should be
optimized for.
It is not "optimized" for that in any way. We either validate it to be
an error, or we don't. It does not alter anything else.
What do you think about the proposal to precede the "meta parameter"
name with @, since we have issues with reserving yet another name
(all good names seems to be in use somewhere already).
We proposed @attributes, so by analogy, it would be @params_hash, or
equivalent using the word you preferred.
I think my disagreement on this is that I consider adding @something to
the type syntax to be a bigger crime than reserving a word. If it ends
up googleale, I'm okay with it.
It ends up being googlable, we tried using similar searches for
constructs in other languages that use @keyword.
(you probably wanted $params = $defaults + $attributes)
Yes, I did. Thanks for taking the time to figure out what I meant,
because what I said was garbage. Is $hash1 + $hash2 something that
works? I would expect merge behavior there, is that what happens?
In future parser the + operator concatenates arrays (makes a new copy
with the concatenated result), and it merges hashes (also makes a new
copy). You can also use the - operator to remove one or more elements
from lists, or remove (one or more) keys from hashes (again a copy is
returned).
- henrik
--
Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/
--
You received this message because you are subscribed to the Google Groups "Puppet
Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-dev/lse371%24qqs%241%40ger.gmane.org.
For more options, visit https://groups.google.com/d/optout.