Trying to compile sample from The D Programming Language book.

spir denis.spir at gmail.com
Sun Apr 3 03:34:52 PDT 2011


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



More information about the Digitalmars-d-learn mailing list