Re: Why won't mmutable ranges stack?

2010-12-26 Thread doubleagent
== Quote from Simen kjaeraas (simen.kja...@gmail.com)'s article > Also note that auto is unnecessary when another storage class is > specified (const,immutable). Ah, that's right! > There have been several asking for tail-const (i.e. const(int)[]) > support for ranges other than arrays. I have e

Why won't mmutable ranges stack?

2010-12-26 Thread doubleagent
Compare the following two programs which take a string of whitespace separated binary and decode it's message eg echo "01001101 01100101 01110010 01110010 0001 0010 0111 01101000 01110010 01101001 01110011 01110100 01101101 0111 01110011 0011 0011 0011" | ./main.d http:

Re: string comparison

2010-12-21 Thread doubleagent
> In general though, it's preferred that you post a link to code rather than > attach it I'll try to remember that.

Re: string comparison

2010-12-20 Thread doubleagent
Good & I agree.

Re: string comparison

2010-12-20 Thread doubleagent
> This could be related to bug 2954, for which a fix will be released in > the next version of DMD. Looking at that new descriptive error message ie error("associative arrays can only be assigned values with immutable keys, not %s", e2->type->toChars()); it appears to be a distinct possibility.

Re: string comparison

2010-12-20 Thread doubleagent
> Okay. I don't know what the actual code looks like Here. import std.stdio, std.string; void main() { uint[string] dictionary; // v[k], so string->uint foreach (line; stdin.byLine()) { // break sentence into words // Add each word in the sentence

Re: string comparison

2010-12-20 Thread doubleagent
> The reason that std.string.splitter() does not show in the documentation is > that > its return type is auto, and there is currently a bug in ddoc that makes it so > that auto functions don't end up in the generated documentation. Looking at > the > code, it pretty much just forwards to std.alg

Re: string comparison

2010-12-20 Thread doubleagent
I understand. Thank you, and thanks for pointing out the chatroom.

Re: string comparison

2010-12-20 Thread doubleagent
> Are you 100% sure that you are running this version I have to be. There are no other versions of phobos on this box and 'which dmd' points to the correct binary. > dictionary[word.idup] = newId; That fixes it. > The 'word' array is mutable and reused by byLine() on each iteration. By > doi

Re: string comparison

2010-12-19 Thread doubleagent
Compared to the relatively snappy response other threads have been receiving I'm going to assume that nobody is interested in my inquiry. That's cool. Can anybody point me to an IRC chatroom for D noobs, and is there anywhere to post errata for the book?

string comparison

2010-12-18 Thread doubleagent
Andrei's quick dictionary illustration [in his book, 'The D Programming Language'] doesn't seem to work. Code attached. On my computer, with d2-0.5.0, I got the following output while testing. andrei 0 andrei andrei 1 andrei Also, why doesn't 'splitter' show up on the site's docum