write, toString, formatValue & range interface

Nick Voronin elfy.nv at gmail.com
Wed Dec 15 15:25:14 PST 2010


I guess the discussion on bugzilla strayed quite far from original point,  
so I'll answer here.

> I don't understand you point about "Now if we bundle data and Range  
> interface
> together all kind of funny things happen." A type that implement a range  
> always
> holds data, usually provides many other features that just  
> range/iteration,

Look into std/container.d. Containers hold data, Ranges traverse data (and  
are separate struct types). Think, how would you generally hold data in  
something which exhaust itself on iteration? There is save(), but then  
again it may not be there :) And it creates _new_ range object. See, all  
kind of complications from mixing things, when they are intended to  
simplify programing.

-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/


More information about the Digitalmars-d mailing list