|
86 | 86 |
|
87 | 87 | % Colors used for for different kinds of text.
|
88 | 88 | \definecolor{normativeColor}{rgb}{0,0,0}
|
89 |
| -\definecolor{commentaryColor}{rgb}{0.6,0.6,0.6} |
90 |
| -\definecolor{rationaleColor}{rgb}{0.6,0.6,0.6} |
| 89 | +\definecolor{commentaryColor}{rgb}{0.5,0.5,0.5} |
| 90 | +\definecolor{rationaleColor}{rgb}{0.5,0.5,0.5} |
91 | 91 |
|
92 | 92 | % Environments for different kinds of text.
|
93 | 93 | \newenvironment{Q}[1]{{\bf #1}}{}
|
|
165 | 165 | {#1}_1\,\EXTENDS\,{#2}_1,\,\ldots,\ %
|
166 | 166 | {#1}_{#3}\,\EXTENDS\,{#2}_{#3}}}
|
167 | 167 |
|
| 168 | +% Used to specify comma separated lists of symbols followed by |
| 169 | +% \EXTENDS{}, as needed for type parameter declarations where we do |
| 170 | +% not intend to refer explicitly to the bounds. |
| 171 | +% Parameters: Type parameter name, number of type parameters. |
| 172 | +\newcommand{\TypeParametersNoBounds}[2]{\ensuremath{% |
| 173 | + {#1}_1\,\EXTENDS\,\ldots,\ \ldots,\ {#1}_{#2}\,\EXTENDS\,\ldots}} |
| 174 | + |
168 | 175 | % For consistency, we may as well use this whenever possible.
|
169 | 176 | \newcommand{\TypeParametersStd}{\TypeParameters{X}{B}{s}}
|
170 | 177 |
|
|
185 | 192 | \newcommand{\FunctionType}[6]{\leavevmode\par\noindent\code{%
|
186 | 193 | \ensuremath{#1}{#2}\FUNCTION<\FTTypeParameters{#3}{#4}{#5}>({#6})}}
|
187 | 194 |
|
| 195 | +% Same as \FunctionType except suitable for inline usage, hence omitting |
| 196 | +% the spacer argument. |
| 197 | +\newcommand{\RawFunctionType}[5]{\code{% |
| 198 | + \ensuremath{#1}\ \FUNCTION<\FTTypeParameters{#2}{#3}{#4}>({#5})}} |
| 199 | + |
188 | 200 | % Used to specify function types with positional optionals:
|
189 | 201 | % Arguments: Return type, spacer, type parameter name, bound name,
|
190 | 202 | % number of type parameters, parameter type, number of required parameters,
|
|
193 | 205 | \FunctionType{#1}{#2}{#3}{#4}{#5}{\List{#6}{1}{#7},\ %
|
194 | 206 | [\List{#6}{{#7}+1}{{#7}+{#8}}]}}
|
195 | 207 |
|
| 208 | +% Same as \FunctionTypePositional except suitable for inline usage, |
| 209 | +% hence omitting the spacer argument. |
| 210 | +\newcommand{\RawFunctionTypePositional}[7]{% |
| 211 | + \RawFunctionType{#1}{#2}{#3}{#4}{\List{#5}{1}{#6},\ % |
| 212 | + [\List{#5}{{#6}+1}{{#6}+{#7}}]}} |
| 213 | + |
196 | 214 | % Used to specify function types with named parameters:
|
197 | 215 | % Arguments: Return type, spacer, type parameter name, bound name,
|
198 | 216 | % number of type parameters, parameter type, number of required parameters,
|
|
201 | 219 | \FunctionType{#1}{#2}{#3}{#4}{#5}{\List{#6}{1}{#7},\ %
|
202 | 220 | \{\PairList{#6}{#8}{{#7}+1}{{#7}+{#9}}\}}}
|
203 | 221 |
|
| 222 | +% Same as \FunctionType except suitable for inline usage, hence omitting |
| 223 | +% the spacer argument. |
| 224 | +\newcommand{\RawFunctionTypeNamed}[8]{% |
| 225 | + \RawFunctionType{#1}{#2}{#3}{#4}{\List{#5}{1}{#6},\ % |
| 226 | + \{\PairList{#5}{#7}{{#6}+1}{{#6}+{#8}}\}}} |
| 227 | + |
204 | 228 | % Used to specify function types with no optional parameters:
|
205 | 229 | % Arguments: Return type, spacer, type parameter name, bound name,
|
206 | 230 | % number of type parameters, parameter type,
|
|
235 | 259 | \newcommand{\NotMoreSignatureSpecific}[2]{%
|
236 | 260 | \ensuremath{{#1}\NotMoreSignatureSpecificSymbol{#2}}}
|
237 | 261 |
|
| 262 | +% Judgment expressing that a subtype relation exists. |
| 263 | +\newcommand{\Subtype}[3]{\ensuremath{{#1}\vdash{#2}\,<:\,{#3}}} |
| 264 | +\newcommand{\SubtypeStd}[2]{\Subtype{\Gamma}{#1}{#2}} |
| 265 | +% Subtype judgment where the environment is omitted (NE: "no environment"). |
| 266 | +\newcommand{\SubtypeNE}[2]{\ensuremath{{#1}\,<:\,{#2}}} |
| 267 | + |
| 268 | +% Judgment expressing that a supertype relation exists. |
| 269 | +\newcommand{\Supertype}[3]{\ensuremath{{#1}\vdash{#2}\,:>\,{#3}}} |
| 270 | +\newcommand{\SupertypeStd}[2]{\Supertype{\Gamma}{#1}{#2}} |
| 271 | + |
| 272 | +% Judgment expressing that an assignability relation exists. |
| 273 | +\newcommand{\AssignableRelationSymbol}{\ensuremath{\Longleftrightarrow}} |
| 274 | +\newcommand{\Assignable}[3]{% |
| 275 | + \ensuremath{{#1}\vdash{#2}\,\AssignableRelationSymbol\,{#3}}} |
| 276 | +\newcommand{\AssignableStd}[2]{\Assignable{\Gamma}{#1}{#2}} |
| 277 | + |
| 278 | +% Semantic function delivering the superinterfaces of a class. |
| 279 | +\newcommand{\Superinterfaces}[1]{\ensuremath{\metavar{Superinterfaces}({#1})}} |
| 280 | +\newcommand{\Superinterface}[2]{{#1}\in\Superinterfaces{#2}} |
| 281 | + |
238 | 282 | % ----------------------------------------------------------------------
|
239 | 283 | % Support for hash valued Location Markers
|
240 | 284 |
|
|
0 commit comments