seandenigris / Magritte

The Magritte Meta-Model. This fork is almost synced with upstream, minus a few experiments.
4 stars 0 forks source link

Generated Descriptions have Cruft #20

Open seandenigris opened 6 years ago

seandenigris commented 6 years ago

E.g.:

descriptionFile
    <magritteDescription>
    ^ MAToOneRelationDescription new
        reference:
            (MAContainer basicNew
                instVarAt: 1 put: Dictionary new;
                instVarAt: 2 put: MAIdentityAccessor new;
                instVarAt: 3 put: OrderedCollection new;
                yourself);
        classes: Set new;
        yourself

The #reference: and #classes: setup here is unneeded because they were not changed from the default.

Also, there is the related ugly generated argument to #classes: when the collection is not empty:

classes:
    (Set new
        add: RlPDF;
        add: FileReference;
        add: FileLocator;
        yourself)

Which would seem cleaner as: { RlPDF. FileReference. FileLocator }

seandenigris commented 6 years ago

Fix for the first part (i.e. defaults unchanged) is to supply a default that will match that generated:

MARelationDescription>>descriptionReference
    …
        default: MAContainer new;
    …

and

MARelationDescription>>descriptionClasses
    …
        default: Set new;
    …