Error message issue

Russel Winder russel at russel.org.uk
Sat Mar 12 04:45:33 PST 2011


Coming from Java, C++, etc. where + is used for string concatenation I
initially wrote:

        assert ( iterative ( item[0] ) == item[1] , "iterative ( " + to ! string ( item[0] ) + " ) = " + to ! string ( item[1] ) ) ;

which results in:

        factorial_d2.d(45): Error: Array operation "iterative ( " + to(item[0u]) + " ) = " + to(item[1u]) not implemented

which does seem a bit off the wall.  Replacing + with ~ fixes the
problem, but the error message above wasn't that helpful in being able
to deduce this.

I think this is somewhat more than a RTFM, or "you should know the
basics of the language" in that D is very like C and Java and yet in
this one place has chosen a different symbol for the operation.

Not a big issue, just irritating.

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at russel.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20110312/09b9dca3/attachment.pgp>


More information about the Digitalmars-d mailing list