Move the declaration of receives & privately receives to be inlined and no longer defined at the head of an agent block. This facilitates a more minimal, fluid & refactorable syntax.
Firstly, and most importantly, the only truly public part of the agent's interface are the events that it sends, because only these are of interest to other agents (or user-agents). Any events that the agent receives are internal to the agent; the sending agent doesn't know or care who receives the event. The only party to an agent that cares what the agentreceives is a user-agent that directly sends the agent messages, and are considered rather private to the agent.
Secondly, when authoring an agent in the DSL, the point at which an author creates a state block is the first time he considers which event that the agentreceives. At that moment, the author is required to navigate to the head of the agent declaration to declare the receives clause, then navigate back to the state block, which is annoying and is error-prone when refactoring.
For example, the current syntax
agent Test concerning Test {
receives finished
sends started: Test
privately receives ^start: Test
initially receives ^start becomes working sends started
{
done {
}
working {
receives finished becomes done
}
}
}
becomes
agent Test concerning Test {
sends started: Test
initially receives ^start:Test becomes working sends started
{
done {
}
working {
receives finished becomes done
}
}
}
Issue by matthewadams Monday Sep 19, 2016 at 18:48 GMT Originally opened as https://github.com/SciSpike/yaktor-dsl-xtext/issues/14
Move the declaration of
receives
&privately receives
to be inlined and no longer defined at the head of anagent
block. This facilitates a more minimal, fluid & refactorable syntax.Firstly, and most importantly, the only truly public part of the
agent
's interface are the events that itsends
, because only these are of interest to otheragent
s (or user-agents). Any events that theagent
receives are internal to theagent
; the sendingagent
doesn't know or care whoreceives
the event. The only party to anagent
that cares what theagent
receives
is a user-agent that directly sends theagent
messages, and are considered rather private to theagent
.Secondly, when authoring an
agent
in the DSL, the point at which an author creates a state block is the first time he considers which event that theagent
receives
. At that moment, the author is required to navigate to the head of theagent
declaration to declare thereceives
clause, then navigate back to the state block, which is annoying and is error-prone when refactoring.For example, the current syntax
becomes