-
Notifications
You must be signed in to change notification settings - Fork 1
Console
Console provides a simple entry point. It allows to call predefined functions loaded through plugins or extensions, or to call methods on object living or reachable through the console's context.
Command invocations:
open std-window
echo "Hello world" > std-window
create entity book, "This entity describes a book"
create attribute title String > book
Method invocations:
windows.open(std-window)
std-window.write("Hello world")
entities.create(book, "This entity describes a book")
book.append(attributes.create(title, String))
Redirection simply means capturing output from a command or script and sending it as input to another target or window. Default and predefined outputs are the stdout (channel 1) for standard output and stderr (channel 2) for error output. Both are by default redirected to the standard window stdwin.
something > other is equivalent to other.send(something)
Generally this implies that the content of other is replaced by the output of the something expression.
something >> other is equivalent to other.append(something)
Generally this implies that the output of the something expression is appended to the content of other.
Similar to bash scripting, it is possible to redirect outputs to different target:
create entity book stdout> win-out stderr> win-err > my-namespace
This will create an new entity named book, standard output is sent to the win-out window, standard error is sent to win-err, and command output (the entity created) is sent to my-namespace which should be an existing namespace.
Using the channel identifier (similar to the bash file descriptor) this can also be written:
create entity book 1> win-out 2> win-err > my-namespace
According to this
create entity book > my-namespace
is roughly equivalent to
create entity book 1> stdwin 2> stdwin > my-namespace
Channel is the base component for pipelining output. Default channels are stdout and stderr which transports the standard output and standard error output.
It is possible to create custom channel
create channel mychannel
the output in stdout would then be similar to
> Channel 'mychannel' created with identifier 3
This gives the ordinal identifier of the channel that can be used in place of its name (not recommended) in redirection.
It is also possible to redirect the content of a channel to a window (in fact window acts as a channel) or an other channel.
create entity book > my-namespace, mychannel
The entity created is then sent to both 'my-namespace' and 'mychannel'.
Triggered execution ~ can also be used to pipe (without redirection) channel's output to another channel.
For example, send all stdout output (aka standard output, because everything that is sent to stdout, is transmitted 'as is' to its output channel) to another channel:
stdout ~>> mychannel
Any output can contains command that could be retrieved through the window activation and navigation: using the window help-window to define the currently selected window and arrow up/arrow down to navigate into it.
Supposes one call help create > help-window
The content of the help-window would be similar to:
'help create' gives all commands that are prefixed by the create keyword
Currently availables commands are:
Console Management
------------------
'create window' create a new window
Entity Management
-----------------
'create attribute' creates a new attribute.
'create entity' creates a new entity
...
Navigation using the arrow down key will sequentially grab all commands from the window (identified by the surrounding ' character) and set the following content at the console carret position:
help createcreate windowcreate attributecreate entity- ...