www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Trying to compile sample from The D Programming Language book.

--0016363b8bd2948dae049ffe562a
Content-Type: text/plain; charset=UTF-8

Hello, I am completely stuck on this error, any help would be appreciated...
google was not helpful (too many useless matches for "D <error>").

I am trying to compile this:

import std.string, std.algorithm, std.conv, std.ctype, std.regex, std.range,
std.stdio;
// blah blah blah
auto words = split(sentence, regex("[ \t,.;:?]+"));
// blah blah blah


and two compilers (gdc, dmd) are giving me this error (output from gdc):

main.d:34: Error: std.string.split at
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../include/d2/4.5.1/std/string.d:69
conflicts with std.regex.split(String) at
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../include/d2/4.5.1/std/regex.d:3096


And I am clueless. How can they conflict, it's the standard library. It must
be in the usage of split. As this is the second or third example in chapter
one, I have no clue what is going on.

Thanks!

--0016363b8bd2948dae049ffe562a
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hello, I am completely stuck on this error, any help would be appreciated..=
. google was not helpful (too many useless matches for &quot;D &lt;error&gt=
;&quot;).<div><br></div><div>I am trying to compile this:</div><div><br>
</div><blockquote class=3D"webkit-indent-blockquote" style=3D"margin: 0 0 0=
 40px; border: none; padding: 0px;"><div><div><div>import std.string, std.a=
lgorithm, std.conv, std.ctype, std.regex,=C2=A0std.range, std.stdio;</div><=
/div>
</div><div>// blah blah blah</div><div>auto words =3D split(sentence, regex=
(&quot;[ \t,.;:?]+&quot;));</div><div>// blah blah blah</div></blockquote><=
div><br></div><div>and two compilers (gdc, dmd) are giving me this error (o=
utput from gdc):</div>
<div><br></div><blockquote class=3D"webkit-indent-blockquote" style=3D"marg=
in: 0 0 0 40px; border: none; padding: 0px;"><div>main.d:34: Error: std.str=
ing.split at /usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../includ=
e/d2/4.5.1/std/string.d:69 conflicts with std.regex.split(String) at /usr/l=
ib/gcc/x86_64-unknown-linux-gnu/4.5.1/../../../../include/d2/4.5.1/std/rege=
x.d:3096</div>
</blockquote><div><br></div><div>And I am clueless. How can they conflict, =
it&#39;s the standard library. It must be in the usage of split. As this is=
 the second or third example in chapter one, I have no clue what is going o=
n.</div>
<div><br></div><div>Thanks!</div><div><br></div>

--0016363b8bd2948dae049ffe562a--
Apr 03 2011