Free cookie consent management tool by TermsFeed Policy Generator

Opened 16 years ago

Closed 16 years ago

Last modified 13 years ago

#93 closed defect (done)

DelegatingOperator puts name translations of local variables into the scope

Reported by: gkronber Owned by: swagner
Priority: low Milestone: HeuristicLab 3.3.0
Component: Operators Version: 3.0
Keywords: Cc:

Description

The DelegatingOperator (and thus the CombinedOperator) puts name translations for all it's VariableInfos into the scope. However since (optional) local variables of the CombinedOperator are not accessible via scopes for the sub-operators this behavior is not 100% consistent.

This defect didn't lead to errors yet however it looks like a possible cause for future problems.

Change History (10)

comment:1 follow-up: Changed 16 years ago by swagner

Yes, that's true.

We can fix this behavior by automatically injecting and removing local variables into the scope when applying a DelegatingOperator. Right?

However, local variables of operators cause troubles. The original idea for local variables was to be able to have some kind of static parameterization of operators in order to mimic literals passed as parameters. Together with the ongoing thoughts to refactor the whole operator calling mechanism (keyword "call objects") I plan to remove local variables at all in the future and to replace them by constant objects that can be defined as actual parameters when calling an operator.

comment:2 in reply to: ↑ 1 Changed 16 years ago by gkronber

Replying to swagner:

Yes, that's true.

We can fix this behavior by automatically injecting and removing local variables into the scope when applying a DelegatingOperator. Right?

Yes, however as you also state below this doesn't match the current design. A pragmatic solution is to create a translation only when the local-flag of the VariableInfo is false.

comment:3 follow-up: Changed 16 years ago by swagner

Well, I'm not quite sure about that. Just creating translations for non-local variables would break variable lookup in sub-operators when trying to fetch a variable that was declared as local in the responsible DelegatingOperator. Therefore local variables would not be useable in DelegatingOperators. So I think the lesser evil is to inject local variables.

comment:4 in reply to: ↑ 3 Changed 16 years ago by gkronber

Replying to swagner:

Well, I'm not quite sure about that. Just creating translations for non-local variables would break variable lookup in sub-operators when trying to fetch a variable that was declared as local in the responsible DelegatingOperator. Therefore local variables would not be useable in DelegatingOperators. So I think the lesser evil is to inject local variables.

Oops yes, didn't think about that! It feels better to put the 'local' variable into the scope anyway. It's actually natural to have a local variable of a combined-operator available in the sub-operators.

comment:5 Changed 16 years ago by swagner

Ok, then I will implement it that way.

comment:6 Changed 16 years ago by swagner

  • Status changed from new to assigned

comment:7 Changed 16 years ago by swagner

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed in r113

comment:8 Changed 15 years ago by swagner

  • Milestone changed from 3.0 to Iteration 0

Milestone 3.0 deleted

comment:9 Changed 13 years ago by swagner

  • Milestone changed from Iteration 0 to Current

Milestone Iteration 0 deleted

comment:11 Changed 13 years ago by swagner

  • Milestone changed from Current to HeuristicLab 3.3.0

Milestone Current deleted

Note: See TracTickets for help on using tickets.