You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An {\em function or method invocation} executes a named function or method declared in a given source file. An invocation passes arguments of appropriate number and type to the executed function or method. An invocation may also return one or more values which can be subsequently used.
254
+
An {\em function or method invocation} executes a named function or method declared in a given source file. An {\em indirection function or method invocation} executes a function determined by a given expression. An invocation passes arguments of appropriate number and type to the executed function or method. An invocation may also return one or more values which can be subsequently used.
255
255
256
256
% Could also discuss function or method lookup; this is really part of typing.
The {\em arrow operator} returns a field of the value referenced by the argument.
509
+
\paragraph{Examples.} The following example illustrates a field access expression constructor:
513
510
514
-
\paragraph{Examples.}
515
-
516
-
\paragraph{Notes.} The arrow operation ``\lstinline{e->f}'' is a short-hand notation for ``\lstinline{(*e).f}'' and can be used when \lstinline{e} has effective record type (\S\ref{c_types_effective_records}).
511
+
\lstinputlisting{../examples/ch6/eg_23.whiley}
517
512
513
+
The above function computes the so-called {\em dot product} of two vectors. The field access operator is used to access the three fields of each vector.
A {\emdereference expression} accepts an argument of reference type and returns a value (or element) of the reference's target type. The {\em dereference operator} returns the value referenced by the argument.
562
+
A dereference expression accepts an argument of reference type and returns a value (or element) of the reference's target type. The {\em dereference operator} returns the value referenced by the argument. The {\em arrow operator} returns a field of the value referenced by the argument.
This function traverses a linked list counting the number of links it contains. The arrow operator is used to access the next link in the chain.
578
574
579
-
\paragraph{Notes.}
575
+
\paragraph{Notes.} The arrow operation ``\lstinline{e->f}'' is a short-hand notation for ``\lstinline{(*e).f}'' and can be used when \lstinline{*e} has effective record type (\S\ref{c_types_effective_records}).
0 commit comments