Whither Tango?
Adam D. Ruppe
destructionator at gmail.com
Sat Feb 20 07:34:42 PST 2010
Let's try to get some alternative names proposed so maybe we can reach
a compromise. I say we throw stuff out there and see what sticks.
Side note: there should be some magic thing that lets you punch in
a symbol, and immediately go to the docs.
Actually, I'll do it now.
http://arsdnet.net/dcode/find.php
Source at the bottom of this message.
On Sat, Feb 20, 2010 at 10:16:48PM +0800, KennyTM~ wrote:
> Major silly names:
>
> - std.file.slurp
formattedReadAll? Not quite the same as readf() (as in opposite of writef),
but close.
> - std.iterator.retro, std.range.retro
inReverse()
> - std.random.dice (it is a discrete distribution...)
proportional()
> - std.range.cons
prepend()
> - std.range.iota
step()
> - std.string.chomp, chompPrefix, chop
cutOffEnd, cutOffBeginning, cutOffTrailingNewline
blargh, I really prefer chomp to those.
> - std.string.munch
skipPattern()
eat() <- probably what I would have called it in my own code...
> - std.string.sformat
I've never even wanted to do that; let a performance optimization keep
its little name.
> - std.utf.stride (which is totally different from std.range.stride)
sequenceLength?
> - std.contracts.enforceEx (sounds like Win32 API which you should use
> in favor of enforce.)
Can it be combined into enforce, using a default parameter for the
exception?
> - std.stream.Stream.readBlock & writeBlock (sounds like blocking vs
> non-blocking operations, esp. for SocketStream.)
I like these, but maybe readDataBlock?
What I'd prefer to do is if there are blocking vs nonblocking, use
readBlocking -- the 'ing' would be important. Or better yet make it a
parameter passed in.
> - std.path.rel2abs (why not relToAbs?)
> - std.range.sameHead (should be sameFront?)
> - and many inconsistent naming conventions, e.g.
> * std.string.ljustify vs stripl
> * std.string.countchars (all lower) vs inPattern (CamelCase)
Agreed on these.
find.php source
=================
<?php
if(isset($_GET['symbol'])) {
$version = $_GET['version'] == '2.0' ? '2.0' : '1.0';
$name = strtolower($_GET['symbol']);
$name = preg_replace('[^a-z0-9_\.]', '', $name);
$module = substr($name, 0, strrpos($name, '.'));
$function = substr($name, strrpos($name, '.') + 1);
$module = str_replace('.', '_', $module);
$url = "http://digitalmars.com/d/$version/phobos/$module.html#$function";
header("Location: $url");
//echo $url;
exit;
}
?>
<html>
<head>
<title>Find D Symbol</title>
</head>
<body onload="document.getElementById('symbol').focus();">
<h1>D Doc finder</h1>
<p>Enter the full name of the symbol in here. Example: <tt>std.file.read</tt> or <tt>std.string.indexOf</tt>.</p>
<table>
<form>
<tr>
<th>D version</th>
<td><input name="version" value="1.0" type="radio" /> 1.0
<br><input name="version" value="2.0" checked type="radio" /> 2.0
</tr>
<tr>
<th>Symbol:</th>
<td><input id="symbol" name="symbol" size="40" /></td>
</tr>
<tr>
<th> </th>
<td><input type="submit" value="Go to" /></td>
</tr>
</form>
</table>
</body>
</html>
================
--
Adam D. Ruppe
http://arsdnet.net
More information about the Digitalmars-d
mailing list