[OT] Finding longest documents

Bill Baxter wbaxter at gmail.com
Wed Oct 15 14:44:30 PDT 2008


On Thu, Oct 16, 2008 at 5:46 AM, Sergey Gromov <snake.scaly at gmail.com> wrote:
> Wed, 15 Oct 2008 14:04:44 -0500,
> Andrei Alexandrescu wrote:
>> Sergey Gromov wrote:
>> > Wed, 15 Oct 2008 09:49:08 -0500,
>> > Andrei Alexandrescu wrote:
>> >> Sergey Gromov wrote:
>> >>> Wed, 15 Oct 2008 09:17:57 -0500,
>> >>> Andrei Alexandrescu wrote:
>> >>>> I see how it breaks those conventions, but I've never heard of them. The
>> >>>> convention I heard of is that if you want dynamic polymorphism you use
>> >>>> classes, otherwise you don't.
>> >>> How about if you want pass-by-value you use structs, otherwise you don't?
>> >>> My argument against structs-collections is that I want to toss
>> >>> collections around and build other collections out of them without
>> >>> messing with pointers.
>> >> A struct can choose to implement value or reference semantics as it
>> >> pleases. The only thing it can't readily implement is dynamic polymorphism.
>> >
>> > I can imagine the documentation: "Ignore the fact it's a struct, it's
>> > actually a reference internally."
>>
>> No. "Don't submit to the dogma that struct == value semantics, because
>> that was never true".
>
> I don't understand.  Structs are value types, everything else are
> implementation details.

I think the point is that value *type* doesn't necessarily imply value
*semantics*.
Like with D's built-in arrays.

--bb



More information about the Digitalmars-d mailing list