Tor Iver Wilhelmsen coughed up:
Funny, I was just thinking of this while out walking the dog today.
This is of course all just silly musing, so punt it if you like and do
something more productive like downloading lesbian porn.
-----Option 1------
Using "/": Simple single-types added for comparison:
ArrayList of String: "arraylist of strings"
ArrayList of ArrayList of String: "arraylist of arraylists of strings"
ArrayList of HashMap of String/Collection: "arraylist of hashmaps, each
one a hashmap of key:String and value:Collection
HashMap of String/(ArrayList of Long): hashmap of key:String and
value:an arraylist of Longs
OR maybe "+":
ArrayList of HashMap of String+Collection: "arraylist of hashmaps, each
one a hasshmap of key:String and value:Collection
HashMap of String+(ArrayList of Long): hashmap of key:String and
value:an arraylist of Longs
-----Option 2------
You put in things like an "and" clause, but what I'd really prefer is
something a little more like a named parameter:
Map of Key:String and Value:ArrayList of String map = ...
Or if you really got worried about the grouping, the good ol' parens fix it
all:
Map of Key:String and Value
ArrayList of String) map = ...
Note that this would mean that something like "Type" would be the default
type and could be removed, so the
ArrayList of String
is the shorthand for
ArrayList of Type:String
So the map thing might also be:
Map of Key:String and Value
ArrayList of Type:String) map = ...
The "Type" is just a default named parameter.
I prefer option 1 overall. I think it's much cleaner than what we have, but
YMMV....