Up: The Glish 2.6
There are many areas in which the Glish language or system may
evolve in the future. We list here the likely changes (or, in some
cases, changes at least being considered), some of which will not be
- A way for providing ``type signatures", both for Glish functions
and whenever statements, and for programs using the Client Library.
The signature would provide run-time type-checking, and also automatic
partition of a value into its components. For example,
whenever a->b(numeric c, string d) do
would respond to any b event generated by agent a by
first checking whether its value had a numeric ``c" field and
a string ``d" field, and if so then assigning those
fields to local variables ``c" and ``d".
Similarly, in a Glish client, something along the lines of:
client->Register( "b", "numeric c, string d",
which would register the client as responding to the same sort
of b event by calling my_func with arguments ``c"
- Perhaps a ``module" facility to support precompiled script
- Support for
exception handling when using await and request/reply events (§ 7.4, page ).
- print needs to be more sophisticated, to support
an ``in" operator for determining whether a
field is in a record, rather than has_field() (§ 9.1, page ),
which is somewhat inefficient and clumsy to use.
C-style operators, such as ``? :" and perhaps ``++".
- A mechanism
for ``adding" one record to another, including all
of its fields.
- Making the implicit semi-colon insertion algorithm (§ 5.11, page )
never insert a semi-colon if there is a pending close-parenthesis (i.e.,
more open-parentheses have been seen than close-parentheses).
- An ``Incomplete()" member function for Client, similar
to Unrecognized(), for reporting events that arrive without all
the necessary values (record fields). The various Value:Field() member
functions would record the last field they were asked to find but couldn't,
so Incomplete() could generate an event identifying which field
was missing (or had the wrong type).
- The ability
to compare records element-by-element using the ``=="
- An ascii=T optional argument to read_value() to make
the resulting file human-readable. Of course, write_value()
should be able to read the result.
- Similarly, making the input= argument to shell() and
client() more imaginative about how it turns event values into text.
For example, 1:10 should generated 10 lines, one integer per line,
instead of a single line of the numbers surrounded by 's.
- Sprucing up the limited stdin interface provided to stand-alone
clients (§ 13.5.1, page ).
- Additional mathematical functions,
such as sgn()
- Additional functions for manipulating strings: extracting substrings,
searching for patterns, substitution. Perhaps the ``+" operator should
perform spaste() (§ 9.5, page ) when invoked with string
- Perhaps allow assignment between multiple record fields and a
single vector with the same number of values:
r["x y z"] := [0, 0, 10]
would assign r.x to 0, r.y to 0, and r.z
- Perhaps make
await an expression (returning $value)
instead of a statement.
- Perhaps redefine ref so that it ``distributes" across
records. For example, ``a["b c"] := ref d["x y"]" would
make a.b a reference to d.x and a.c a reference
- A more flexible record-constructor that expands any
records inside it, so that [a=1, [b=2, c=3]] becomes equivalent to
[a=1, b=2, c=3], just as [1, [3, 5]] is presently
equivalent to [1, 3, 5].
- A ``trace"
feature that reports when large internal copies
are done, so inefficiencies in Glish scripts can be tracked down.
- Functions for ``walking" records or vectors and applying
other functions to each element or field.
- num_args() and nth_arg() should default to
apply to ``..." if no arguments are given.
- A mechanism
for efficiently deleting a field from a record.
- Perhaps a
``compound-assignment" statement for extracting pieces
of a vector or a record:
a, b, c := d
would assign the first field (or element) of d to a, the
second field to b, and the remainder to c.
- A mechanism for
recording events and later playing them back
or displaying them for analysis.
flexible use of uninitialized variables, rather than just
generating a warning and assigning them to F. Perhaps simply
do away with the warning message.
for ``an x event generated by any agent"
(``*->foo") or ``any event whatsoever" (``*->*'').
- Presently there is a division between functions that are
actually built into the Glish interpreter and those that are defined
in the glish.init file (§ 14.6, page ). The former do
not support named arguments or variable argument lists. This restriction
should be removed, as it will make it much easier to add more
- for loops should work for iterating over record's as
well as vectors.
- Probably for loop indices should be implicitly local
unless explicitly made global.
- A mechanism for
dealing with out-of-band events, and for
flushing event queues under exceptional conditions.
- The ``..." ellipsis should ``remember" its name=value
bindings so they are preserved if the ellipsis is passed as an argument
to another function.
- A mechanism
for allowing ``unexpected" clients to ``join" a
Glish script. The present mechanism (using async=T in a call
to client(); see § 7.8.1, page ) requires that the script
anticipate that a client may wish to join.
- Probably the full set of ANSI escape sequences will be
supported in string literals.
- Executing the same link statement more than once should
not cause the link source to send multiple copies of the given event,
but instead do nothing if the link is already established.
- A mechanism for terminating a subsequence.
- More flexible type conversion in Value::Polymorph().
- Perhaps split() should return empty strings if it finds multiple,
adjacent split characters.
- Changing the environ global should probably change the environment.
- Errors in executing shell commands and asynchronous shell clients
should probably result in events being generated.
- The ``short-circuit" && and
|| operators should
complain if one of their operands is not a scalar, instead of just
using the first element of the operand. The same holds for values
tested in conditionals.
Up: The Glish 2.6
Thu Nov 13 16:44:05 EST 1997