[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.technology.gmt] Re: MOFScript: rules context type must be a metamodel type?
|
Ed Willink a écrit :
> Hi Yannick
>
>> I tried this:
>>
>> toto(){
>> // code: stdout ...
>> }
>>
>> but it doesn't compile. I'd really like to write something like that so
>> that I can make smaller functions and thus easier to understand.
>>
>>
>> Could you help me please?
>>
> If everything in your meta-model inherits from Object or Element or some
> similar
> abstract class you can provide a single implementation for the root
> class, or
> at least sufficient root classes to cover all derived classes of interest.
>
> Regards
>
> Ed Willink
>
Thanks for your answer, though I had found that I can use the same
context type than the one containing my loop. I previously tried that
but I had an error (from another problem) so I thought It didn't work :p
ex:
uml.Class::myfunction(){
property num:Integer=3
num ->forEach(n){
self.dummy()
}
}
--------------------
1)
uml.Class::dummy(){
//write code
}
2)
super.interface.or.abstract.class::dummy(){
//write code
}
If I'm right you proposed solution 2, but solution 1 also works.
Well thanks for your help and sorry for the inconvenience :p