www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4849] New: Remove str.string.abbrev()

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

           Summary: Remove str.string.abbrev()
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc


--- Comment #0 from bearophile_hugs eml.cc 2010-09-10 12:17:33 PDT ---
It's good to have minimal APIs, because this reduces the time to learn it, and
reduces the time to find the right function/method to use in code.

So I suggest to remove the str.string.abbrev() function. Its purpose is not
common enough in programs, and its name is not nice.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 10 2010
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4849


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich gmail.com


--- Comment #1 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2010-09-10
14:09:34 PDT ---
Aww, I was just looking at this function yesterday and it would come in handy
for autocompletion in a text editor. I can always copy the code, I guess..

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 10 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4849



--- Comment #2 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2010-09-10
14:14:06 PDT ---
(In reply to comment #1)
 Aww, I was just looking at this function yesterday and it would come in handy
 for autocompletion in a text editor. I can always copy the code, I guess..
A bigger WTF is the soundex function. How do you determine how a word sounds? And what if it's not an English word, would it sound different (I assume it would sometime)? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 10 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4849



--- Comment #3 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2010-09-11
07:58:00 PDT ---
I think this might need renaming, but also I would want this to have additional
functionality. If some characters are capitalized, you should be able to
abbreviate by using only those chars, e.g.:

static string[] list = [ "FoodAndDrinks", "FoodAndCocacola" ];

auto abbrevs = std.string.abbrev(list);

foreach (key, value; abbrevs)
{
    writefln("%s => %s", key, value);
}

This should print out, among other things:
...
FAD => FoodAndDrinks
FooAD => FoodAndDrinks
FAC => FoodAndCocacola

Then it would be much more usable as an autocomplete feature. But I don't know
if this belongs in Phobos.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 11 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4849



--- Comment #4 from bearophile_hugs eml.cc 2010-09-11 08:45:49 PDT ---
Even if you want to keep it in Phobos, it needs to be renamed and to be moved
out of the std.string module. Because it's not a commonly useful string
functionality, it muds the string API.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 11 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4849


Andrei Alexandrescu <andrei metalanguage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |andrei metalanguage.com
         AssignedTo|nobody puremagic.com        |andrei metalanguage.com


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


Andrei Alexandrescu <andrei erdani.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |WONTFIX


--- Comment #5 from Andrei Alexandrescu <andrei erdani.com> 2013-03-04 15:33:27
PST ---
The name isn't awful enough to warrant a rename at this point. I think we're in
good shape.

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