source: git/dyn_modules/openmath/xmlencodetest.py @ 3c473c

spielwiese
Last change on this file since 3c473c was 3c473c, checked in by Kai Krüger <krueger@…>, 14 years ago
rename directory modules to dyn_modules anticipating "modules" directory for cmake. git-svn-id: file:///usr/local/Singular/svn/trunk@13033 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 859 bytes
Line 
1from objects import *
2from context import *
3import CD.arith1 as arith1
4context=Context()
5context.push({})
6i=OMint(22482489)
7#print i.body
8print i.XMLEncode(context)
9print context.XMLEncodeObject(i)
10v=OMVar("x")
11print v.XMLEncode(context)
12x=v
13y=OMVar("y")
14a=OMApply(OMSymbol("plus",arith1.content),[x,y,i])
15print a.XMLEncode(context)
16print context.XMLEncodeObject(context.evaluate(a))
17a1=OMApply(OMSymbol("plus",arith1.content),[OMint(1),OMint(2)])
18a2=OMApply(OMSymbol("plus",arith1.content),[a1,OMint(2)])
19a3=OMApply(OMSymbol("plus",arith1.content),[a2,x])
20context.addCDImplementation(arith1.implementation)
21print "a3", context.XMLEncodeObject(context.evaluate(a3))
22print "a2", context.XMLEncodeObject(context.evaluate(a2))
23print "a1", context.XMLEncodeObject(context.evaluate(a1))
24
25f=OMfloat(1.23434)
26print context.XMLEncodeObject(f)
27#print v.XMLAttributes
28
Note: See TracBrowser for help on using the repository browser.