Here are some thoughts:
* In certain instances an actor needs to send a simple message directly to another actor, often in response to an earlier message.
* There are types of messages that only make sense to send to a single actor, never to a group.
* In order to both eliminate the need to create a message class for these simple messages, and to prevent them from being sent out to a group by accident we need a new way of sending messages.
* The receiver however still needs to specify that they accept this message and declare how it should be handled
For lack of a better term we can continue to call these type of messages 'adhoc messages'. Here are some notes on implementation.
* adhoc messages are sent by name and only directly to another actor.
* having an adhoc message and a regular message of the same name is an error. the easiest way to detect this is to check when sending an adhoc message if a regular message of the same name has been declared, and fail if so.
* as a first step adhoc messages should probably not contain any data. it is possible to relax this limitation going forward to send a single data value with an adhoc message.
So the syntax for sending an adhoc message should be:
trigger_to_actor(some_actor, 'SomeMessage')
which closely mirrors the syntax for sending regular messages of
trigger_to_actor(some_actor, SomeMessage())
There should not be any differences between receiving adhoc messages and regular messages, so the receiver still needs to list 'SomeMessage' in the list of messages it subscribes to, and implemented handle_SomeMessage.
Thoughts?