Water 5-Meta Programming-ExecuteContract| Return type | wob | | Parameter key | Default value | Type | | source | opt | | env_or_context | null | | a_ekind | code | path | | returns | "last" | string | | Parameter kind | Default value | Type | | Other unkeyed arguments | opt with ekind of bytes | wob | | Water Contract<method execute
source =opt
env_or_context=null
a_ekind =ekind.code
returns ="last"
_other_unkeyed=opt=wob=ekind.bytes="_body"/> | |
See also: execute_string, execute_expression, execute
Execute executes a source string and returns the result.
The string can be passed as the value of the source attribte or
as the content of the call.
a wob
| Parameter key | Default value | Type |
| source | opt |
<execute source="2.<plus 3/>" />
 | 5 |
The source can also be an expression.
<execute source=<expression><or false true/></expression>/>
 | "" |
If the source is a file object, the string of the file content is treated as the
source to execute. Some systems would call this functionality "load".
Since this returns a value, you can "get an object" out of a source file.
<execute source=<file "logical://user/steam_info.h2o"/>/>.<is_a thing/>
 | true |
Note that when passing the source as an attribute, you must use the
key 'source' because of the ability to also pass source in the content.
a wob
| Parameter key | Default value | Type |
| _other_unkeyed | opt with ekind of bytes | wob |
When giving the source to execute in the content, you must have a full closing tag.
<execute> 4.<times 5/> </execute>
 | "" |
a wob
| Parameter key | Default value | Type |
| env_or_context | null |
env_or_context is the environment to evaluate the expression in.
An env is just an object that contains the binding of local variables.
<execute source="2.<plus aa/>" env_or_context=<thing aa=7/>/>
 | 9 |
a wob
| Parameter key | Default value | Type |
| a_ekind | code | path |
Execute takes an execution_kind argument which determines how to execute the source.
a woba_ekind=ekind.code
This is the default a_ekind.
Treat the
source or content as a string or expression and execute it.
<execute source="6.<minus 2/>" a_ekind=ekind.code/>
 | "" |
Note that the ekind of the source argument is
ekind.code.
This is indepdentdet of the actual ekind used to interpret the value of the
source argument after it is passed to the method.
<execute source="6.<minus".<join " 5/>"/> a_ekind=ekind.code/>
 | "" |
a woba_ekind=ekind.expression
Parse the source and return the expression. Do not pass it to the evaluator.
<execute source="6.<minus 2/>" a_ekind=ekind.expression/>
 | <expression>
6.<minus 2/></> |
a woba_ekind=ekind.xdata
Converts the
_subject or content into "data". The source is parsed and
as very limited evaluation, indended primarily for "static" data.
<execute source="<stuff color='red' size=45/>" a_ekind=ekind.xdata/>
 | <data.call _method="stuff" color="red" size=45/>
|
Note that:
- "stuff" needn't even be defined. No attempt at "calling" it is made.
- 45 turns into an integer
- 'red' turns into a string of 3 characters.
a woba_ekind=ekind.string
Just return the source as a string.
<execute source="abc" a_ekind=ekind.string/>
 | "abc" |
<execute a_ekind=ekind.string>abc</execute>
 | "abc" |
a woba_ekind=ekind.bytes
<execute source="abc" a_ekind=ekind.bytes/>
 | "abc" |
© Copyright 2007 Clear Methods, Inc.