[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [mdt-ocl.dev] Question regarding operations on UnlimitedNatur al taking UnlimitedNatural argument
|
HI Axel
It's not easy. - I gave up.
The mature parser was written before UnlimitedNatural was properly
identified. I think only '*' is parsed as unlimited natural, although all
non-negative integers should be.
1.oclIsTypeOf(UnlimitedNatural) = true.
'*' really is a mess, requiring conversion to invalid when assigned to
Integer variable.
I have raised an OMG issue suggesting that +infinity, at least, exist for
all numerics.
------------------------------
I suggest that you try to bound your ambition to correct the mature code.
My intention was to do just 1% of the fixes and move on to the pivot for the
100%.
You may well be able to do 50%, perhaps even 75%, but is that really worth
it?
Regards
Ed
> -----Original Message-----
> From: mdt-ocl.dev-bounces@xxxxxxxxxxx
> [mailto:mdt-ocl.dev-bounces@xxxxxxxxxxx] On Behalf Of Axel Uhl
> Sent: 18 April 2011 15:22
> To: MDT OCL mailing list
> Subject: [mdt-ocl.dev] Question regarding operations on
> UnlimitedNatural taking UnlimitedNatural argument
>
> Hi,
>
> there are operations defined on UnlimitedNatural in the 2.3
> spec which
> as argument take an UnlimitedNatural (e.g., div, mod, max,
> min and the
> comparison operations). The current parser creates IntegerLiteralExp
> expressions for non-negative integer literals such as 0, 1, ...
>
> This leads to a glitch for expressions such as
>
> *.div(1)
>
> because * parses to an UnlimitedNaturalLiteralExp, 1 parses to an
> IntegerLiteralExp, Integer does not conform to UnlimitedNatural and
> hence the operation UnlimitedNatural::div(UnlimitedNatural) is not
> applicable.
>
> Now, Integer::div(Integer) would be applicable, but it's not
> clear to me
> whether these operations should be visible for the specialization
> UnlimitedNatural. What's your take on this?
>
> Currently, the "mature" implementation for Ecore gives up on any
> expression of this sort, and I wonder whether and how to fix it.
>
> Best,
> -- Axel
> _______________________________________________
> mdt-ocl.dev mailing list
> mdt-ocl.dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/mdt-ocl.dev
>
Please consider the environment before printing a hard copy of this
e-mail.
The information contained in this e-mail is confidential. It is intended
only for the stated addressee(s) and access to it by any other person is
unauthorised. If you are not an addressee, you must not disclose, copy,
circulate or in any other way use or rely on the information contained in
this e-mail. Such unauthorised use may be unlawful. If you have received
this e-mail in error, please inform us immediately on +44 (0)118 986 8601
and delete it and all copies from your system.
Thales Research and Technology (UK) Limited. A company registered in
England and Wales. Registered Office: 2 Dashwood Lang Road, The Bourne
Business Park, Addlestone, Weybridge, Surrey KT15 2NX. Registered Number:
774298
Thales UK Limited. A company registered in England and Wales. Registered
Office: 2 Dashwood Lang Road, The Bourne Business Park, Addlestone,
Weybridge, Surrey KT15 2NX. Registered Number: 868273