www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5404] New: .stringof is not documented

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5404

           Summary: .stringof is not documented
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: websites
        AssignedTo: nobody puremagic.com
        ReportedBy: peter.alexander.au gmail.com



12:48:09 PST ---
The usage of .stringof on its own (with no preceding object) doesn't appear to
be documented anywhere, yet it appears to be legal and returns the name of the
module it resides in, e.g. in foo.d, it would evaluate to "module foo".

This should be added to the language spec.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 03 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5404




12:50:18 PST ---
Also, if we are in module foo.bar, it returns "module bar". Is this correct
behaviour?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 03 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5404




13:02:17 PST ---
Finally, is there any reason that the return value is prefixed with "module"?

1. I can't imagine any use for it.
2. If people needed it, it would be trivial to add ("module " ~ .stringof)
3. If they don't want it, it's a little trickier (splitter(.stringof)[1], or
ugly .stringof[7..$])

I would recommend that in module foo, .stringof == "foo".

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 03 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5404


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |andrej.mitrovich gmail.com
         Resolution|                            |DUPLICATE



19:54:13 PST ---
*** This issue has been marked as a duplicate of issue 3007 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 11 2013