[䷁ Contents|ReferenceManualExample2] [⬆ Up|ReferenceManualExample2] [⬅ Prev|ReferenceManualExample2] [➡ Next|ReferenceManualExample2]

!!! %%(float: right) ~EntryID /%

!!! Entry Topic Title

!! Description

In many object-oriented programming languages, one calls a method or accesses a field of an object using the dot operator; for example, {{obj.m()}} calls the method {{m}} of the object {{obj}}.

There is a special kind of site call in Orc which serves a similar purpose. One may write {{x.msg}}, for any identifiers {{x}} and {{msg}}. This treats the value bound to {{x}} as a site, and calls it with a special message value {{msg}}. If the site understands the message {{msg}} (for example, if {{x}} is bound to a Java object with a field called {{msg}}), the site interprets the message and responds with some appropriate value. If the site does not understand the message sent to it, it does not respond, and no publication occurs. If {{x}} cannot be interpreted as a site, no call is made.

Typically this capability is used so that sites may be syntactically treated like objects, with multiple methods and fields. For example, a channel {{c}} might understand the messages {{get}} and {{put}}, to get values from and put values on that channel, respectively. Such calls would be written {{c.get()}}, or {{c.put(6)}}.

A call such as {{c.put(6)}} actually occurs in two steps. First {{c.put}} sends the message put to the site {{c}}; this publishes a site whose only purpose is to put values on the channel. Next, that site is called on the argument {{6}}, sending 6 on the channel. Readers familiar with functional programming will recognize this technique as currying.

%%collapsebox-closed
!! Example(s)
! Example 1
{{{
-- Ask one question, then ask another after
-- receiving the answer
Prompt("What was the last movie you saw?")

  >>
 
Prompt("Was it good?")
}}}

! Example 2
{{{
-- Ask one question, then ask another after
-- receiving the answer
Prompt("What was the last movie you saw?")

  >>
 
Prompt("Was it good?")
}}}
/%

%%collapsebox-closed
!! Common Problems and Indications

* Failure to crosscheck and correctly interpret outside and instrument references
* Application of control movements rather than pressures
* Uncoordinated use of flight controls
* Faulty altitude and bank control
* Faulty trim procedure
/%

!! Assumptions
!! Links in text

!! Syntax EBNF (or Site Declaration)
''~ArgGroup'' ::= \\
         | . ''Identifier''	



!! Related Reference Topics
* [Site|ReferenceManualExample2]
* [JavaCall|ReferenceManualExample2]
* [Baz|ReferenceManualExample2]

!! Related Tutorial Sections
* [The {{.}} notation|https://orc.csres.utexas.edu/userguide/html/ch01s04.html#N10B4D]
* [Bar|ReferenceManualExample2]
* [Baz|ReferenceManualExample2]

[䷁ Contents|ReferenceManualExample2] [⬆ Up|ReferenceManualExample2] [⬅ Prev|ReferenceManualExample2] [➡ Next|ReferenceManualExample2]