Grouping gives the capability to create reusable modules, or subroutines that can dramatically simplify more complicated systems. Groups may be created in the following ways:
Zooming in on a group allows you see and edit its contents. Groups may be nested heirarchically, which gives an excellent way of zooming in to see the detail of a model, or zooming out to get an overview of it.
Around the edges of a group are input or output variables, which allow one to parameterise the group. One can drag a variable and dock it in the I/O area to create a new input or output for the group.
When creating a group, or dragging a variable or operation into or out of a group, if a wire ends up crossing the group boundary, a new temporary variable is added as an I/O variable.
Variable names within groups are locally scoped to that group. That
means that a variable of the same name outside the group refers to a
different entity completely. One can refer to variables outside the
current scope by qualifying the variable name. The simplest
qualification to understand is global scope, which is specified by
prepending a `:' to the variable name. To refer to a variable in
another group, the notation is <group id>:<name>
, where
<group id>
is the integer id of the group in question. An
alternative equivalent notation is <description>[<group id>]:<name>
, where <description>
is the textual name given to
the group. The description string is ignored by Minsky on input--only
the group id is important, but this mechanism makes it easier to see
what variable belongs to which group in the drop down lists in the
name field. Please try to keep the group names distinctive in their
first five characters, as Minsky will truncate the descriptive string
to fit in the drop down menu.
A group can also be exported to a file from the context menu. This allows you to build up a library of building blocks. There is a github project ``minsky-models'' allowing people to publish their building blocks and models for others to use. In the future, we hope to integrate Minsky with this github repository, allowing even more seamless sharing of models.
Russell Standish 2017-01-05