Water 5-Meta Programming-Execute
method execute
Contract
Return typewob
Parameter keyDefault valueType
sourceopt
env_or_contextnull
a_ekindcodepath
returns"last"string
Parameter kindDefault valueType
Other unkeyed argumentsopt with ekind of byteswob
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 keyDefault valueType
sourceopt

<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 keyDefault valueType
_other_unkeyedopt with ekind of byteswob
When giving the source to execute in the content, you must have a full closing tag.

<execute> 4.<times 5/> </execute>
""

a wob
Parameter keyDefault valueType
env_or_contextnull
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 keyDefault valueType
a_ekindcodepath
Execute takes an execution_kind argument which determines how to execute the source.

a wob
a_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 wob
a_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 wob
a_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:
a wob
a_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 wob
a_ekind=ekind.bytes
<execute source="abc" a_ekind=ekind.bytes/>
"abc"