Minor extension to cast syntax
Gregor Richards
Richards at codu.org
Wed Oct 31 14:17:03 PDT 2007
Bruce Adams wrote:
> Gregor Richards Wrote:
>
>> Gregor Richards wrote:
>>>> There is that idea in language design that if it can be done as a
>>>> function it should be unless there is a good reason not to.
>>> In highly dynamic languages where performance isn't a primary objective,
>>> yes. Dynamic arrays, anyone?
>>>
>> I should also mention, while I'm at it, that this can NOT be done as a
>> function.
>>
>> - Gregor Richards
>
> It could if your language was dynamic enough to support types as first class objects so that no meta syntax was required. :)
>
Yeah, but that's a matter of goals ... I love dynamic languages, my pet
language is entirely prototype-based, so "types" are really just
prototype objects, and are therefore passable like any other object. It
makes things like generics really easy and intuitive, and of course
casting is just one comparison away :)
But D is a static language, and has different goals.
- Gregor Richards
More information about the Digitalmars-d
mailing list