Most of the important details about sending events were covered in the previous section, but this section includes some details that were missed in that overview. Send expressions have two forms:
expression -> name ( val, val, )In both cases Glish evaluates the expression to the left of the
expr -> [ expr ] ( val, val, )
->operator to see whether it's an agent. If not, an error is generated. Otherwise the name of the event is taken from either name or by evaluating expr, which must yield a string scalar. The following are equivalent:
a->foo( 5 ) a->["foo"]( 5 )
The second send-event form is quite flexible. Here, for example, is one way to send a three events, foo, bar and bletch, with values of 1, 2, and 3:
for ( i in 1:3 ) a->["foo bar bletch"[i]]( i )
The value of the event is taken from the various val's. If you specify just one val then that's the event's value. If you don't list any val's then the event's value is F. If you give more than one val then Glish constructs a record from the val's. In this latter case usually the val's are given names, using the same name = expression syntax as when creating records (§ 3.4.1, page ) or calling functions (§ 6.4.1, page ). See § 7.3 for examples of sending events.
Depending on the context in which the send expression occurs, a result value may be required from the agent, e.g.
print a->foobar( action="show all" )here print requires a result value. There are a few salient points regarding these send expressions which require a result: