Thx, maybe this was a little too straight from the hip... BTW: I've tried 
it - it even worked... but I see that's probably caused by a lot of strange 
luck...
 

> Subclasses can never 'override' ancestor class variables.  They can 
> partially *hide* them within their own scope by declaring a same-named 
> local variable, but that has no effect on what the parent class or any 
> other sees as the value of the parent-class variable.
>

Interesting objection - that's actually what I meant saying "override". 
Let's try something else: There's a module "module_x" and these 
directories: $moduledir/module_x/manifests/ and there's an "init.pp" with 
this content:

   class module_x {
    include module_x::child
include module_x::another_child
include module_x::another_child2
include module_x::another_child3
...    
   }

There's also a file 'constant.pp' containing this

    class module_x::constant {
        $var = 'value'
    }

Class module_x::constant is not included. Classes like module_x::child 
should be able to inherit the default value of $var but also be able to 
hide it within their own scope by declaring a same-named local variable. It 
would look like this:

class module_x::child inherits module_x::constant {
// wants to use a default value for $var but should be able to hide it 
within their own scope.
}


Something wrong with that? 

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to