spielwiese
Last change
on this file since aeb6d3 was
aeb6d3,
checked in by Michael Brickenstein <bricken@…>, 18 years ago
|
*bricken: refactoring
git-svn-id: file:///usr/local/Singular/svn/trunk@8372 2c84dea3-7e68-4137-9b89-c4e89433aadc
|
-
Property mode set to
100644
|
File size:
814 bytes
|
Line | |
---|
1 | from binding import * |
---|
2 | from context import * |
---|
3 | from objects import * |
---|
4 | from cd import * |
---|
5 | from omexceptions import * |
---|
6 | |
---|
7 | content=OMCD("arith1") |
---|
8 | implementation=OMCDImplementation(content) |
---|
9 | |
---|
10 | plussym=OMSymbol("plus",content) |
---|
11 | |
---|
12 | def plusfunc(context, *args): |
---|
13 | #print "plusfunc", args |
---|
14 | args=[context.toGeneric(o) for o in args] |
---|
15 | if len(args)==0: |
---|
16 | return content.package(0) |
---|
17 | else: |
---|
18 | erg=args[0] |
---|
19 | for i in xrange(1,len(args)): |
---|
20 | erg=erg+args[i] |
---|
21 | return erg |
---|
22 | implementation.implement("plus", plusfunc) |
---|
23 | #print implementation[sym] |
---|
24 | #print plussym |
---|
25 | #print sym==plussym |
---|
26 | #print implementation[plussym] |
---|
27 | #plusimpl=ImplementedOMSymbol(plussym,plusfunc) |
---|
28 | #implementation[plussym]=plusimpl |
---|
29 | #print "Laenge", (len(implementation.implementations)) |
---|
30 | #assert OMSymbol("plus",content)==OMSymbol("plus",content) |
---|
Note: See
TracBrowser
for help on using the repository browser.