May 03, 2008
On 03/05/2008, Russell Lewis <webmaster@villagersonline.com> wrote:
>  So I asked myself: are there any other common programming models that D
> doesn't have?  And it struck me: most interpreted languages have duck typing
> and hold-any-value variables.  Is there space for that in D?

We already have hold-any-value variables!

std.variant.Variant

We also effectively have compile-time duck typing (but not runtime duck typing), because that's just how templates work. Runtime...? Hmm. That would require runtime reflection, I think.
May 03, 2008
Janice Caron wrote:
> On 03/05/2008, Russell Lewis <webmaster@villagersonline.com> wrote:
>>  So I asked myself: are there any other common programming models that D
>> doesn't have?  And it struck me: most interpreted languages have duck typing
>> and hold-any-value variables.  Is there space for that in D?
> 
> We already have hold-any-value variables!
> 
> std.variant.Variant

Hmm...I'll have to go look that up!

> We also effectively have compile-time duck typing (but not runtime
> duck typing), because that's just how templates work. Runtime...? Hmm.
> That would require runtime reflection, I think.

After I wrote my previous post, it occurred to me the opDot, combined with an associative array, might give us duck typing.

In other words, we might *already* have all of this!  (Just hidden behind a little bit of syntax.)
1 2
Next ›   Last »