Problem with allocation keywords in slot-specs 
Author Message
 Problem with allocation keywords in slot-specs

Hello,

I think I am hitting a bug in the Gwydion Dylan compiler when I
try to define classes using the allocation keywords ``class'' or
``each-subclass''. (I am using version 2.3.1 right now.)

Here's the minimal code that triggers the problem:

    define class <fromble-witz> (<object>)
        class slot bar :: <integer> = 5;
    end class <fromble-witz>;

    define method main(appname, #rest arguments)
        let thud = make(<fromble-witz>);
        format(*standard-output*, "%d\n", thud.bar);
        exit(exit-code: 0);
    end method main;

When I try to compile, I get the following message:

    [...]
    Processing test.dylan
    ...
    Expected an instance of {Class <instance-slot-info>}, but got
    {<class-slot-info> instance}
    make: *** [test] IOT trap/Abort

This also happens when I replace the class slot with an each-subclass
slot, with the change that "...but got {<class-slot-info> instance}"
becomes "...but got {<each-subclass-slot-info> instance}".

I don't run into any problem with virtual or instance slots, though.

Neel



Wed, 13 Mar 2002 03:00:00 GMT  
 Problem with allocation keywords in slot-specs

Quote:

> I think I am hitting a bug in the Gwydion Dylan compiler when I
> try to define classes using the allocation keywords ``class'' or
> ``each-subclass''. (I am using version 2.3.1 right now.)

Definitely. From the d2c source
(gd/src/d2c/compiler/convert/defclass.dylan):

      <each-subclass-slot-info> =>
        // ### Add stuff to the derived-evaluations function to init the
        // slot.  If the slot is keyword-initializable, add stuff to the
        // maker to check for that keyword and change the each-subclass
        // slot.
        error("Can't deal with each-subclass slots yet.");
      <class-slot-info> =>
        // ### If the slot is keyword-initializable, add stuff to the maker
        // to check for that keyword and change the class slot.
        error("Can't deal with class slots yet.");

What puzzles me is that you don't get this error, but another one.

Andreas

--
"Niemand hat die Absicht, eine Firewall einzurichten"



Wed, 13 Mar 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Dylan Tip #101: don't use keyword init-values with class allocated slots

2. keywords to slot-names

3. :ALLOCATION :CLASS: getting slot value

4. Fix for shared slot allocation

5. CLOS: slots with :allocation :class

6. CLOS :allocation slot types

7. accessibility :allocation :class slot

8. Modula2 Ver 3.1 lang specs vs lang specs of 32bit compiler inc in new cw203

9. Modula2 Ver 3.1 lang specs vs lang specs of 32bit compiler inc in n

10. Structure slot-init accessing previous slot

11. Slots of a slot definition metaobject

12. extracting keywords from %(keyword)s-based templates

 

 
Powered by phpBB® Forum Software