[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.mdt.ocl] Re: def expression?

Hi Joel
I'm not sure about your whole problem but when you mention removing variables from environments I get very uncomfortable.

Why is that?

It means that the Environment has a very clear locality. Nested environments are always valid for the context that initialised them.


Note that OCL 2.0 does not support remove of elements from an Environment.

It is much easier
to created a nested environment for the nested scope and revert to the
outer ebvironment when you want to recover context.

You'll find nested environments are easy too, and you cannot forget to match your adds with removes.

I haven't worked with these nested environments yet, but I'll keep it in mind. However, I'd have to create a nested environment for each variable that I add. Adding and removing variables is easy and works well for me so far.

If it works for you fine. Just beware that if you start to do more interesting things, it might bite later.


	Regards

		Ed Willink