April 03, 2011 Re: Trying to compile sample from The D Programming Language book. | ||||
---|---|---|---|---|
| ||||
On 04/03/2011 09:38 AM, Jesus Alvarez wrote: > I got it to compile adding std.regex to split to make it: > > auto words = std.regex.split (sentence, regex("[ \t,.;:?]+")); > > So now my question is, is this an error in the book? The errata doesn't > mention anything about this section. If the TDPL code does not prefix split then, yes, it is an error. (In fact, there was maybe no regex split at the time it was written.) You may add it at the errata page mentionned by Jonathan. > Why do I have to prepend std.regex? How can the compiler guess you mean std.regex.split; and not std.string.split, if you don't tell it? Denis -- _________________ vita es estrany spir.wikidot.com |
Copyright © 1999-2021 by the D Language Foundation