libseed-list Fwd: [Bug 610317] New: Provide a builtin dir() function



Do people think this belongs on the Seed object (Seed.dir()) or should it be global? We were trying not to clutter up the global namespace, but making it global would probably make it more obvious for people coming from elsewhere.

Begin forwarded message:

Date: February 17, 2010 17:11:02 EST
Subject: [Bug 610317] New: Provide a builtin dir() function

https://bugzilla.gnome.org/show_bug.cgi?id=610317
 seed | libseed | git head

          Summary: Provide a builtin dir() function
   Classification: Other
          Product: seed
          Version: git head
       OS/Version: Linux
           Status: UNCONFIRMED
         Severity: normal
         Priority: Normal
        Component: libseed
       AssignedTo: seed-maint gnome bugs
       ReportedBy: diegoe gnome org
     GNOME target: ---
    GNOME version: ---


Just like in Python, this is doable in _javascript_ easily:

function dir(object)
{
   methods = [];
   for (z in object) if (typeof(z) != 'number') methods.push(z);
   return methods.join(', ');
}

--
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]