Compiler patch for runtime reflection

Ary Manzana ary at esperanto.org.ar
Tue Oct 25 11:12:21 PDT 2011


On 10/25/11 1:05 PM, Robert Jacques wrote:
> On Tue, 25 Oct 2011 11:31:18 -0400, Gor Gyolchanyan
> <gor.f.gyolchanyan at gmail.com> wrote:
>> As i said before, enabling reflection manually is an act of enabling a
>> certain range of stuff you can do with the code. Forgetting to enable
>> reflection can lead to serious problems, when the reflection is
>> required.
>
> And when, precisely, is reflection _required_? Granted, in other
> languages it is the only tool for the job. But we have a very big
> toolkit in D, and so far, I have yet to see any example (including
> Rails) which _requires_ the holistic runtime reflection proposed in
> these threads.

This is completely true. Something like:

class Person < ActiveRecord::Base
   belongs_to :company
end

could be done at compile-time. Same as retrieving the schema from mysql: 
could be done at compile-time, like Nemerle does (or so I remember 
someone said that).

Me too, believes that greater compile-time capabilities will make almost 
all (but never all) runtime reflection unnecessary.


More information about the Digitalmars-d mailing list