|
4.28.2 pyobject expressions
A pyobject expression is (optional parts in square brackets):
-
an identifier of type pyobject
-
a function returning pyobject
-
pyobject expressions combined by the arithmetic operations
+ , - , * , / , or ^ , and the member-of
operators . and ::
-
an list expression with elements made of pyobject expressions
(see Type conversion and casting)
-
an string expression (see Type conversion and casting)
-
an int expression (see Type conversion and casting)
Example:
| pyobject pystr = "python string ";
==> no pyobject support
pystr;
==> ? missing blackbox_String
==>
==> ? error occurred in or before ./examples/pyobject_expressions.sing lin\
e 2: ` pystr;`
pyobject pyint = 2;
pyint;
==> ? missing blackbox_String
==>
==> ? error occurred in or before ./examples/pyobject_expressions.sing lin\
e 4: ` pyint;`
pyobject pylst = list(pystr, pyint);
==> ? missing blackbox_Copy
==> ? error occurred in or before ./examples/pyobject_expressions.sing lin\
e 5: ` pyobject pylst = list(pystr, pyint);`
pylst;
==> ? `pylst` is undefined
==> ? error occurred in or before ./examples/pyobject_expressions.sing lin\
e 6: ` pylst;`
pyint + pyint;
==> ? `pyobject` + `pyobject` failed
==> ? error occurred in or before ./examples/pyobject_expressions.sing lin\
e 7: ` pyint + pyint;`
pyint * pyint;
==> ? `pyobject` * `pyobject` failed
==> ? error occurred in or before ./examples/pyobject_expressions.sing lin\
e 8: ` pyint * pyint;`
pystr + pystr;
==> ? `pyobject` + `pyobject` failed
==> ? error occurred in or before ./examples/pyobject_expressions.sing lin\
e 9: ` pystr + pystr;`
pystr * pyint;
==> ? `pyobject` * `pyobject` failed
==> ? error occurred in or before ./examples/pyobject_expressions.sing lin\
e 10: ` pystr * pyint;`
python_eval("17 + 4");
==> ? `python_eval` is not defined
==> ? error occurred in or before ./examples/pyobject_expressions.sing lin\
e 11: ` python_eval("17 + 4");`
typeof(_);
==> ? missing blackbox_Copy
==> ? error occurred in or before ./examples/pyobject_expressions.sing lin\
e 12: ` typeof(_);`
|
|