Anonymous Subclasses and Slots
Hi: Is the following expression supposed to work? Class new compile: âfoo: a ^ a' I am on the latest Pharo 4 image. There is a test doing `Behavior new compile:` in BehaviorTest>>#testCompile but this test doesnât use any variables/arguments, so the problem does not appear. The issue is that the `layout` of the result of `Class new` is nil, which cases the compiler to fail, when it sends #allSlots when determining the instanceScope. Thanks Stefan -- Stefan Marr INRIA Lille - Nord Europe http://stefan-marr.de/research/
On 02 Apr 2015, at 14:23, Stefan Marr <smalltalk@stefan-marr.de> wrote:
Hi:
Is the following expression supposed to work?
Class new compile: âfoo: a ^ aâ
I think people use the classbuilder/classInstaller for creating classes. #newAnonymousSubclass uses it: e.g. Object newAnonymousSubclass compile: âfoo: a ^ aâ
The issue is that the `layout` of the result of `Class new` is nil, which cases the compiler to fail, when it sends #allSlots when determining the instanceScope.
We should fix that⦠âClass newâ should return a class with valid default values. Marcus
participants (2)
-
Marcus Denker -
Stefan Marr