Changeset c012463 in git for modules/openmathserver/binding.py
- Timestamp:
- Jun 15, 2005, 11:38:16 AM (19 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 04f6a4e219c5180c44ff638afd7e63cc8ffa3699
- Parents:
- d0eb8c62a0f20ffc02130a688aabd569d1ac4430
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/openmathserver/binding.py
rd0eb8c rc012463 1 from objects import OM object, OMsymbol1 from objects import OMObjectBase, OMsymbol 2 2 from cd import * 3 3 from omexceptions import * 4 4 from itertools import izip 5 from copy import copy 5 6 cdFns1=OMcd("fns1") 6 7 lambdasym=OMsymbol("lambda",cdFns1) … … 9 10 return lambdasym==sym 10 11 11 class OMbinding(OMobject): 12 class OMbinding(OMObjectBase): 13 """hopefully fixed possible problems: reevaluation writes new scope, if it isn't 14 meant so, references do not work correctly because of scopes 15 solve this by first evaluation to bounded OMbinding""" 12 16 def __init__(self, binder,variables,block): 13 17 super(OMbinding,self).__init__() … … 15 19 self.binder=binder 16 20 self.variables=variables 21 self.bounded=False 17 22 def evaluate(self,context): 18 23 assert islambda(self.binder) 19 self.scope=context.scopeFromCurrentScope() 20 return self 24 if not self.bounded: 25 mycopy=copy(self) 26 mycopy.scope=context.scopeFromCurrentScope() 27 mycopy.bounded=True 28 return mycopy 29 else: 30 return self 21 31 def bind(self, args): 22 32 #print args, self.variables
Note: See TracChangeset
for help on using the changeset viewer.