spielwiese
Last change
on this file since c36fda was
c36fda,
checked in by Oleksandr Motsak <motsak@…>, 10 years ago
|
Moved all the outdated modgen related stuff to /old_modgen/ for now
|
-
Property mode set to
100644
|
File size:
597 bytes
|
Line | |
---|
1 | "Implementation of arith1 content dictionary" |
---|
2 | from objects import OMSymbol |
---|
3 | from cd import OMCD, OMCDImplementation |
---|
4 | #from omexceptions import * |
---|
5 | |
---|
6 | content = OMCD("arith1") |
---|
7 | implementation = OMCDImplementation(content) |
---|
8 | |
---|
9 | plussym = OMSymbol("plus", content) |
---|
10 | |
---|
11 | def plusfunc(context, *args): |
---|
12 | "tries, convert to generic and adding" |
---|
13 | args = [context.toGeneric(omobj) for omobj in args] |
---|
14 | if len(args) == 0: |
---|
15 | return content.package(0) |
---|
16 | else: |
---|
17 | erg = args[0] |
---|
18 | for i in xrange(1, len(args)): |
---|
19 | erg = erg+args[i] |
---|
20 | return erg |
---|
21 | implementation.implement("plus", plusfunc) |
---|
Note: See
TracBrowser
for help on using the repository browser.