Apologies here; my email client decided to send the mail before I finished:

On Fri, Oct 16, 2009 at 6:38 PM, Steven Jenkins
<[email protected]> wrote:
> I've tried to not comment on this, but I'm failing, and I'll try real
> hard not to rehash well-known examples, issues, and languages.
>
> Instead, would it be more Ruby-ish to monkeypatch the Object class: e.g.,
>
> class Class
>

class Object
  def initialized?
    return defined? self and !self.nil
  end
end

Or some more user-friendly name, capturing the logical state you want
to test on.

Unfortunately, that's not quite legal Ruby, and I haven't thought
through the issues around it.  But the idea of providing a more
readable check for a common idiom is a reasonable approach.

Steven

--~--~---------~--~----~------------~-------~--~----~
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