Why won't mmutable ranges stack?

doubleagent doubleagent03 at gmail.com
Sun Dec 26 00:59:18 PST 2010


Compare the following two programs which take a string of whitespace separated
binary and decode it's message eg echo "01001101 01100101 01110010 01110010
01111001 00100000 01000011 01101000 01110010 01101001 01110011 01110100
01101101 01100001 01110011 00100001 00100001 00100001" | ./main.d

http://ompldr.org/vNnE5eA
http://ompldr.org/vNnE5eQ

The former works while the latter fails.  It looks like there's some
manipulation of 'bytes' and 'list' when writefln forces evaluation.  My
question is should this happen?

Also, is there a more idiomatic way to do byte conversions?  Something in the
stdlib, perhaps?


More information about the Digitalmars-d-learn mailing list