Interview at Lang.NEXT

Craig Dillabaugh via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Wed Jun 4 14:02:20 PDT 2014


On Wednesday, 4 June 2014 at 18:54:00 UTC, Andrew Edwards wrote:
> On 6/4/14, 2:37 PM, Craig Dillabaugh wrote:
>> On Wednesday, 4 June 2014 at 18:14:22 UTC, Adam D. Ruppe wrote:
>>> On Wednesday, 4 June 2014 at 18:03:48 UTC, Ary Borenszweig 
>>> wrote:
clip
>>
>> But shouldn't the '26' be '1016'?
>
> That should only occur when the concatenation operator (~) is 
> used, in which case the result would be '2006' not '1016'. 
> Since only arithmetic operators are used in this example, the 
> result is as expected.

I must be dyslexic .. I concatenated in the wrong way, and you 
(and Adam) are both right about the ~ operator in D.   However, 
my primary point was that adding a string to a number is really 
an 'undefined' operation.  So I don't think such automatic 
casting is (generally) helpful.


More information about the Digitalmars-d-announce mailing list