Subtype without additional possrep
Posted: Sun Aug 22, 2010 2:56 pm
Sorry--these problems appear to have been around since before you went to beta. It's taken me a while to get around to testing S-by-C support.
Having defined type ELLIPSE I tried this:
TYPE CIRCLE IS { ELLIPSE CONSTRAINT ( THE_A(ELLIPSE) = THE_B(ELLIPSE) ) } ;
It wasn't accepted, complaining that it found "}" when all sorts of other things were expected. Two comments:
1. Tutorial D allows the <derived possrep def list> to be empty.
2. Even if Rel decides to require it, shouldn't the keyword POSSREP be the only thing allowed after the paren that closes the constraint?
That said, I was pleased that
TYPE CIRCLE IS { ELLIPSE CONSTRAINT ( THE_A(ELLIPSE) = THE_B(ELLIPSE) ) POSSREP { R = THE_A(ELLIPSE) }} ;
worked fine. In this case a derived possrep is definitely desirable.
However, next I tried
TYPE posint IS { INTEGER CONSTRAINT ( INTEGER >= 0 ) } ;
and again Rel complained about the premature appearance of "}". But built-in type INTEGER surely has no explicit possrep, so how can I define a derived one (which in any case I really don't want)?
Hugh Darwen
Having defined type ELLIPSE I tried this:
TYPE CIRCLE IS { ELLIPSE CONSTRAINT ( THE_A(ELLIPSE) = THE_B(ELLIPSE) ) } ;
It wasn't accepted, complaining that it found "}" when all sorts of other things were expected. Two comments:
1. Tutorial D allows the <derived possrep def list> to be empty.
2. Even if Rel decides to require it, shouldn't the keyword POSSREP be the only thing allowed after the paren that closes the constraint?
That said, I was pleased that
TYPE CIRCLE IS { ELLIPSE CONSTRAINT ( THE_A(ELLIPSE) = THE_B(ELLIPSE) ) POSSREP { R = THE_A(ELLIPSE) }} ;
worked fine. In this case a derived possrep is definitely desirable.
However, next I tried
TYPE posint IS { INTEGER CONSTRAINT ( INTEGER >= 0 ) } ;
and again Rel complained about the premature appearance of "}". But built-in type INTEGER surely has no explicit possrep, so how can I define a derived one (which in any case I really don't want)?
Hugh Darwen