[racket] How to get arity of make-object? Found answer

From: Stevie Strickland (sstrickl at ccs.neu.edu)
Date: Tue Jun 10 13:30:17 EDT 2014

>From what I recall, the only class of non-top-level `super-new' calls I've seen are those from deep within the mred hierarchy that are under lock protection. I think they were all top-level under that, but that would need to be double-checked.

Stevie

On Jun 10, 2014, at 10:03 AM, Asumu Takikawa <asumu at ccs.neu.edu> wrote:

> On 2014-06-09 11:22:59 +0200, Laurent wrote:
>>   Given that it's easy enough to create a /new/ class on Wednesday that has
>>   3 arguments instead of 2, doesn't it make sense to constrain a given
>>   existing class to have a fixed structure? (just asking)
>> 
>>   Maybe it could also allow for some optimizations.
> 
> I agree, it would be nice (especially for contracts & Typed Racket) if
> `super-new` calls were only allowed in fixed positions such as the
> top-level of a class.
> 
> That should also prevent weird dynamic initialization like in my
> example. Also, the macro could use that information to record the actual
> init arguments in the class so that reflective operations could query
> for them.
> 
>>   I wonder if such a additional constraint would break anything in the
>>   existing code.
> 
> It looks like the majority of uses of `super-new` are at the class
> top-level in the Racket code base. I bet it would break one or two weird
> examples though.
> 
> Cheers,
> Asumu
> ____________________
>  Racket Users list:
>  http://lists.racket-lang.org/users



Posted on the users mailing list.