|
Re: OCL List Comprehensions [message #1738939 is a reply to message #1738931] |
Tue, 26 July 2016 08:54 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi<br>
<br>
Presumably you meant (missing "s")<br>
<pre wrap="">self.items->sum(anItem|anItem.subtotal)</pre>
Currently the OCL specification gives no consideration to
comprehensions, although some consideration was given to it at the
Aachen workshop [1]. I can only conclude that your author was
being a little optimistic.<br>
<br>
Strictly speaking the 'not understood' is in the OCL standard
library rather than in OCL. The new Pivot-based OCL has a library
model in which iterations are modelled and so you could add a
"sum" iterator, however the co-existence of an iteration and an
operation with the same name may provoke a latent bug.<br>
<br>
Regards<br>
<br>
Ed Willink<br>
<br>
<br>
[1] <cite class="_Rm"><a class="moz-txt-link-freetext" href="https://www.google.co.uk/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&ved=0ahUKEwi57p3g3pDOAhWGSRoKHYc2BaMQFggiMAE&url=http%3A%2F%2Fwww.se-rwth.de%2Fpublications%2FReport-on-the-Aachen-OCL-Meeting.pdf&usg=AFQjCNEezfyQBFsVsQdE0KfpBDwsYX2_rQ&bvm=bv.127984354,d.d2s&cad=rja">https://www.google.co.uk/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&ved=0ahUKEwi57p3g3pDOAhWGSRoKHYc2BaMQFggiMAE&url=http%3A%2F%2Fwww.se-rwth.de%2Fpublications%2FReport-on-the-Aachen-OCL-Meeting.pdf&usg=AFQjCNEezfyQBFsVsQdE0KfpBDwsYX2_rQ&bvm=bv.127984354,d.d2s&cad=rja</a></cite><br>
<br>
<br>
<br>
On 26/07/2016 09:23, Philippe de Rochambeau wrote:<br>
</div>
<blockquote cite="mid:nn76m3$vh8$1@xxxxxxxxe.org" type="cite">
<pre wrap="">Hello,
I'm currently attempting to translate the book order system on page 150 of Object-Oriented Analysis and Design for Information Systems, by Raul Sidnei Wazlawick:
Althought the following two expressions are validated by the Eclipse OCL interpreter:
totalValue = items->sum()
totalValue = self.items.subtotal->sum()
this one, which is preferred by the book author, isn't
self.item->sum(anItem|anItem.subtotal)
Are so-called OCL "list comprehensions" not "understood" by the Eclipse OCL Interpreter?
</pre>
</blockquote>
<p><br>
</p>
<br /><br />
<hr style='border:none; color:#909090; background-color:#B0B0B0; height: 1px; width: 99%;' />
<table style='border-collapse:collapse;border:none;'>
<tr>
<td style='border:none;padding:0px 15px 0px 8px'>
<a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient">
<img border=0 src="http://static.avast.com/emails/avast-mail-stamp.png" alt="Avast logo" />
</a>
</td>
<td>
<p style='color:#3d4d5a; font-family:"Calibri","Verdana","Arial","Helvetica"; font-size:12pt;'>
This email has been checked for viruses by Avast antivirus software.
<br><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient">www.avast.com</a>
</p>
</td>
</tr>
</table>
<br />
</body>
</html>
|
|
|
|
Re: OCL List Comprehensions [message #1738949 is a reply to message #1738943] |
Tue, 26 July 2016 09:29 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi<br>
<br>
No, I hadn't. Thanks for pointing it out.<br>
<br>
I think that most committers use NNTP rather than the forum. The
messages display fine in Thunderbird.<br>
<br>
The dual headed newsgroup/forum has been a long standing problem
(some forum messages get lost wrt NNTP). Replacement technology
has been discussed many times but no consensus prevails. I doubt
that it is worth raising a bug.<br>
<br>
I'll consult with others to see what they do. I'm reluctant to
lose HTML, but equally I'm reluctant to to produce painful to read
replies.<br>
<br>
Checking the NNTP message source, I see content type
multipart/alternative with both plain text and HTML in the
message, so it looks like a forum bug that it HTML encodes the
HTML rather than passing it clean or encoding the plain text.<br>
<br>
Perhaps its my fault for picking the wrong alternative from
Thunderbird's three way pop-up, mixed/plain/HTML.<br>
<br>
<u><i><b>Let's force this to HTML and see if just HTML is ok</b></i></u><br>
<br>
Regards<br>
<br>
Ed Willink<br>
<br>
On 26/07/2016 10:08, Philippe de Rochambeau wrote:<br>
</div>
<blockquote cite="mid:nn799n$652$1@xxxxxxxxe.org" type="cite">Hi
Ed, thank you for your reply.
<br>
Have you noticed how your replies are filled with HTML tags?
<br>
</blockquote>
<p><br>
</p>
<br /><br />
<hr style='border:none; color:#909090; background-color:#B0B0B0; height: 1px; width: 99%;' />
<table style='border-collapse:collapse;border:none;'>
<tr>
<td style='border:none;padding:0px 15px 0px 8px'>
<a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient">
<img border=0 src="http://static.avast.com/emails/avast-mail-stamp.png" alt="Avast logo" />
</a>
</td>
<td>
<p style='color:#3d4d5a; font-family:"Calibri","Verdana","Arial","Helvetica"; font-size:12pt;'>
This email has been checked for viruses by Avast antivirus software.
<br><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient">www.avast.com</a>
</p>
</td>
</tr>
</table>
<br />
</body>
</html>
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03359 seconds