POV-Ray : Newsgroups : povray.off-topic : C++ question for the experts : Re: C++ question for the experts Server Time
29 Jul 2024 20:22:48 EDT (-0400)
  Re: C++ question for the experts  
From: clipka
Date: 16 May 2011 02:53:49
Message: <4dd0c9fd@news.povray.org>
Am 16.05.2011 07:01, schrieb Darren New:

> There's similar wording in C#. It's more like "this type is an interface
> to manipulate classes, which aren't really first-class objects, which is
> why we give you this separate data structure to manipulate them." It
> just *feels* like they're not first-class objects, compared to Smalltalk
> or JavaScript or something like that.

I do agree.

For classes to be 1st-class objects, I'd expect to be able to do the 
same things with class expressions that you'd be able to do with class 
names, such as:


     MyClass foo (Class<MyClass> c)
     {
         return new c();
     }

instead of the more cumbersome Java code:

     MyClass foo (Class<MyClass> c)
     {
         Constructor<MyClass> co = c.getConstructor();
         return co.newInstance();
     }

Those are the things that make you /feel/ that the reflection API is 
something designed on top of an earlier language design.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.