File: hp-reference.tex

package info (click to toggle)
gretl 2016d-1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 48,620 kB
  • ctags: 22,779
  • sloc: ansic: 345,830; sh: 4,648; makefile: 2,712; xml: 570; perl: 364
file content (67 lines) | stat: -rw-r--r-- 2,161 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67

\chapter{Rules regarding white space}

Programming languages differ in their rules regarding the use of white
space in a program. Here we set out the rules in hansl.  The rules
differ somewhat between \textit{commands} on the one hand and
\textit{function calls} plus \textit{assignment} on the other.

\section{White space in commands}

Hansl commands are structured as follows: first comes a
\textit{command word} (e.g.\ \texttt{ols}, \texttt{summary}); then
come zero or more \textit{arguments} (often the names of series); then
come zero or more \textit{options} (some of which may take
parameters). The relevant rules are:
\begin{enumerate}
\item The individual elements just mentioned must always be separated
  by at least one space, and where one space is required you are free
  to insert as many as you like.
\item Whenever a parameter is supplied with an option flag, the
  parameter must be attached to the flag with an equals sign, with
  \textit{no} intervening space:
\begin{code}
ols y 0 x --cluster=clustvar  # correct
ols y 0 x --cluster =clustvar # broken!
\end{code}
\end{enumerate}

\section{Spaces in function calls and assignment}

For the most part, white space in function calls and assignment is not
significant; it can be inserted or not at will. For example, in the
following sets of statements each member is equally acceptable
syntactically (though some are ugly!):
\begin{code}
# set 1
y = sqrt(x)
y=sqrt(x)
# set 2
c = cov(y1, y2)
c=cov(y1,y2)
c  = cov(y1 , y2)
\end{code}

However, please note these exceptions:
\begin{enumerate}
\item When an assignment starts with a type keyword such as
  \texttt{series} or \texttt{matrix}, this must be separated from what
  follows by at least one space, as in
\begin{code}
series y = normal() # or: series y=normal()
\end{code}
\item In a function call, the opening parenthesis that marks the start
  of the argument list must be attached to the name of the function
  without intervening space:
\begin{code}
c = cov(y1, y2)  # correct
c = cov (y1, y2) # broken!
\end{code}
\end{enumerate}

\label{LastPage}

%%% Local Variables: 
%%% mode: latex
%%% TeX-master: "hansl-primer"
%%% End: