Changeset 1667822 in git for modules/openmathserver/objects.py
- Timestamp:
- Jun 15, 2005, 1:50:16 PM (18 years ago)
- Branches:
- (u'spielwiese', 'a7324b6e0b44a1a8ed3fa4d9ca3e2ff210ddd52c')
- Children:
- 01cd17fd67cfda8867350bb5007624dde10be224
- Parents:
- 04f6a4e219c5180c44ff638afd7e63cc8ffa3699
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/openmathserver/objects.py
r04f6a4 r1667822 105 105 closing="".join(["</"+self.XMLtag+">"]) 106 106 return "".join([opening,body,closing]) 107 class OM var(OMObjectBase):107 class OMVar(OMObjectBase): 108 108 def __init__(self,name): 109 super(OM var,self).__init__()109 super(OMVar,self).__init__() 110 110 self.name=name 111 111 def evaluate(self,context): … … 142 142 raise UnsupportedOperationError 143 143 144 class OM symbol(OMObjectBase):144 class OMSymbol(OMObjectBase): 145 145 def __init__(self,name,cd=None): 146 super(OM symbol,self).__init__()146 super(OMSymbol,self).__init__() 147 147 self.cd=cd 148 148 self.name=name … … 206 206 def getXMLattributes(self): 207 207 return [XMLattribute("dec",str(self.value))] 208 class OM ref(OMObjectBase):208 class OMRef(OMObjectBase): 209 209 def __init__(self, ref): 210 210 self.ref=ref … … 225 225 context["x"]=OMint(1) 226 226 227 x=OM var("x")228 229 y=OM var("y")227 x=OMVar("x") 228 229 y=OMVar("y") 230 230 231 231 print context.evaluate(x) 232 232 print context.evaluate(y) 233 firstArg=OMbinding(lambdasym,[OM var("x"), OMvar("y")], OMvar("x"))233 firstArg=OMbinding(lambdasym,[OMVar("x"), OMVar("y")], OMVar("x")) 234 234 #print context.evaluate(firstArg) 235 235 application=OMapplication(firstArg, [x,y]) … … 242 242 #application=OMapplication(arith1.plussym,[x]) 243 243 #application=OMapplication(arith1.plussym,[x,x]) 244 application=OMapplication(OM symbol("plus",arith1.content),[x,x])244 application=OMapplication(OMSymbol("plus",arith1.content),[x,x]) 245 245 246 246 print context.evaluate(application) 247 application=OMapplication(OM symbol("plus",arith1.content),[x,x,x])247 application=OMapplication(OMSymbol("plus",arith1.content),[x,x,x]) 248 248 249 249 print context.evaluate(application)
Note: See TracChangeset
for help on using the changeset viewer.