On Feb 1, 2011 10:48 PM, "Luke Kanies" <[email protected]> wrote:
> On Feb 1, 2011, at 3:49 PM, Daniel Pittman wrote:
> > On Tue, Feb 1, 2011 at 15:24, Nigel Kersten <[email protected]>
wrote:
> >> On Tue, Feb 1, 2011 at 2:30 PM, Ian Ward Comfort <[email protected]>
wrote:
> >>> On 1 Feb 2011, at 2:02 PM, Dan Bode wrote:
> >>>> I wanted to open the feature request
> >>>> http://projects.puppetlabs.com/issues/5824 for discussion.
> >
> > [...]
> >
> >>>> I would like to introduce the 'self' keyword to be used in this
> >>>> situation.
> >>>
> >>> I like this idea in theory.  (I limit my statement only because we're
> >>> still in the process of migrating to 2.6.x here, and my ideas about
> >>> parameterized classes and how I'd like to use them are still purely
> >>> theoretical.)  Since the longhand syntax is already permitted,
providing
> >>> "Self" as shorthand doesn't seem too dangerous -- modulo keyword
namespace
> >>> concerns, I guess.
> >>>
> >>> I'm curious to hear Nigel's misgivings, though, in case I'm missing
> >>> something.
> >>
> >> My misgivings are blurry, but center around complexifying what was
meant to
> >> be a "simple DSL".
> >
> > For what it is worth, I could see this being a way out of the morass
> > of referring to the attributes of the declaration rather than the
> > enclosing scope, making the language more useful:
> >
> >    define foo () {
> >        notify { "$name is from my parent": }
> >        notify { "$self::name is from me": }
> >    }
> >    foo { "bar": }
> >
> >    bar is from my parent
> >    foo is from me
> >
> > (...or perhaps backwards :)
>
> Isn't the fix for that to make Puppet's language lexical rather than
dynamic?

Well, one fix. It means an extra temporary variable to expose the name on
the define vs the name of the resource in properties of the resource, but
that would also be OK by me.

Regards,
    Daniel
-- 
Puppet Labs Developer –http://puppetlabs.com
Daniel Pittman <[email protected]>
Contact me via gtalk, email, or phone: +1 (877) 575-9775
Sent from a mobile device. Please forgive me if this is briefer than usual.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to