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? -- Venter's First Law: Discoveries made in a field by some one from another discipline will always be upsetting to the majority of those inside. --------------------------------------------------------------------- Luke Kanies -|- http://puppetlabs.com -|- +1(615)594-8199 -- 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.
