LET and IN [message #490136] |
Wed, 07 October 2009 13:06 |
Eclipse User |
|
|
|
Originally posted by: formatzeh.gmx.de
As I commented in another thread I don't get LET expressions working.
For example the following:
let aspectParams: Set(MyMetaModel::Parameter) =
self.parentIf.parentAspect.events->forAll(ev|
ev.parameter->union(aspectParams)
)
in
aspectParams->includes(self.boolParam)
With that expression I want to check if the referenced boolParam is one
of the parameters of the earlier referenced events of a parent class of
the context class. I get the error in the ocl interpreter example
console that aspectParams isn't recognized. Why does it come as the code
completion does work if I use aspectParams. Another question: is the
above expression correct, especially the generation of the aspectParams
with the recursive union operation?
|
|
|
|
Re: LET and IN [message #490377 is a reply to message #490319] |
Thu, 08 October 2009 13:51 |
Eclipse User |
|
|
|
Originally posted by: formatzeh.gmx.de
Hi Ed,
> You cannot reference aspectParams as the union argument while
> initializing it.
>
Makes sense. I thought the error comes from the latter code. Can you
help me with getting a correct initialization of the aspectParams?
|
|
|
|
|
Re: LET and IN [message #490622 is a reply to message #490517] |
Fri, 09 October 2009 12:54 |
|
--=-ovMenT8G8bPR0qVDeOPU
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Hi, Gilbert,
Try something like this:
let aspectParams: Set(MyMetaModel::Parameter) =
self.parentIf.parentAspect.events.parameter->asSet()
in
aspectParams->includes(self.boolParam)
All you need is a collect iterator, which is implicit in the dot
navigation.
HTH,
Christian
On Fri, 2009-10-09 at 00:06 +0200, Gilbert Mirenque wrote:
> But how can I add elements to the Set without using the Set?
--=-ovMenT8G8bPR0qVDeOPU
Content-Type: text/html; charset="utf-8"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.24.1.1">
</HEAD>
<BODY>
Hi, Gilbert,<BR>
<BR>
Try something like this:<BR>
<BR>
<TT> </TT><TT><FONT COLOR="#000000">let aspectParams: Set(MyMetaModel::Parameter) =</FONT></TT><BR>
<TT><FONT COLOR="#000000"> self.parentIf.parentAspect.events.parameter-></FONT> </TT><TT>asSet()</TT><BR>
<TT> </TT><TT><FONT COLOR="#000000">in</FONT></TT><BR>
<TT> </TT><TT><FONT COLOR="#000000">aspectParams->includes(self.boolParam) </FONT></TT><BR>
<BR>
All you need is a collect iterator, which is implicit in the dot navigation.<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Fri, 2009-10-09 at 00:06 +0200, Gilbert Mirenque wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
But how can I add elements to the Set without using the Set?
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>
--=-ovMenT8G8bPR0qVDeOPU--
|
|
|
Re: LET and IN [message #490964 is a reply to message #490622] |
Mon, 12 October 2009 15:41 |
Eclipse User |
|
|
|
Originally posted by: formatzeh.gmx.de
> All you need is a collect iterator, which is implicit in the dot
> navigation.
Ah Ok, thank you very much
|
|
|
Powered by
FUDForum. Page generated in 0.03292 seconds