2024-06-23 09:01:39 +00:00
#LyX 2.4 created this file. For more info see https://www.lyx.org/
\lyxformat 620
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
2002-06-11 14:22:42 +00:00
\textclass scrbook
2024-06-23 09:01:39 +00:00
\begin_preamble
% Added by lyx2lyx
2024-08-11 06:23:08 +00:00
%\setlength{\parskip}{\medskipamount}
%\setlength{\parindent}{0pt}
2024-06-23 09:01:39 +00:00
\end_preamble
\use_default_options false
2024-08-11 06:23:08 +00:00
\begin_modules
logicalmkup
\end_modules
2024-06-23 09:01:39 +00:00
\maintain_unincluded_children no
2002-06-11 14:22:42 +00:00
\language american
2024-06-23 09:01:39 +00:00
\language_package default
\inputencoding iso8859-1
\fontencoding auto
\font_roman "times" "default"
\font_sans "helvet" "default"
\font_typewriter "courier" "default"
\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_roman_osf false
\font_sans_osf false
\font_typewriter_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\use_microtype false
\use_dash_ligatures true
2024-08-11 06:23:08 +00:00
\graphics default
2024-06-23 09:01:39 +00:00
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
2024-08-11 06:23:08 +00:00
\float_placement tbh
\float_alignment class
2002-06-11 14:22:42 +00:00
\paperfontsize 12
2024-06-23 09:01:39 +00:00
\spacing single
\use_hyperref false
\papersize letter
\use_geometry true
\use_package amsmath 1
\use_package amssymb 1
\use_package cancel 1
\use_package esint 0
\use_package mathdots 0
\use_package mathtools 1
\use_package mhchem 0
\use_package stackrel 1
\use_package stmaryrd 1
\use_package undertilde 1
\cite_engine basic
\cite_engine_type default
\biblio_style plain
\use_bibtopic false
\use_indices false
2002-06-10 04:28:24 +00:00
\paperorientation portrait
2024-06-23 09:01:39 +00:00
\suppress_date false
\justification true
\use_refstyle 0
\use_formatted_ref 0
\use_minted 0
\use_lineno 0
\index Index
\shortcut idx
\color #008000
\end_index
2004-04-28 00:43:03 +00:00
\leftmargin 1in
\topmargin 1in
\rightmargin 0.5in
\bottommargin 1in
2002-06-11 14:22:42 +00:00
\secnumdepth 2
\tocdepth 2
2024-06-23 09:01:39 +00:00
\paragraph_separation indent
\paragraph_indentation default
\is_math_indent 0
\math_numbering_side default
\quotes_style english
\dynamic_quotes 0
2002-06-10 04:28:24 +00:00
\papercolumns 1
2002-06-11 14:22:42 +00:00
\papersides 2
\paperpagestyle headings
2024-06-23 09:01:39 +00:00
\tablestyle default
\tracking_changes false
\output_changes false
\change_bars false
\postpone_fragile_content false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\docbook_table_output 0
\docbook_mathml_prefix 1
\end_header
\begin_body
\begin_layout Title
2002-06-11 14:22:42 +00:00
The Ruamoko Programming Language
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Author
2002-06-11 14:22:42 +00:00
Bill Currie
2004-04-28 00:43:03 +00:00
\begin_inset Formula $\bullet$
2024-06-23 09:01:39 +00:00
\end_inset
2002-06-11 14:22:42 +00:00
Jeff Teunissen
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Publishers
2002-06-11 14:22:42 +00:00
QuakeForge Press
2024-06-23 09:01:39 +00:00
\end_layout
\begin_layout Uppertitleback
This manual is free;
you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation;
either version 2 of the License,
or (at your option) any later version.
\begin_inset Newline newline
\end_inset
\begin_inset Newline newline
\end_inset
This manual is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
2002-06-11 14:22:42 +00:00
See the GNU General Public License for more details.
2024-06-23 09:01:39 +00:00
\begin_inset Newline newline
\end_inset
\begin_inset Newline newline
\end_inset
You should have received a copy of the GNU General Public License along with this manual:
if not,
write to:
\begin_inset Newline newline
\end_inset
\begin_inset Newline newline
\end_inset
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
Free Software Foundation,
Inc.
\begin_inset Newline newline
\end_inset
2002-06-11 14:22:42 +00:00
59 Temple Place - Suite 330
2024-06-23 09:01:39 +00:00
\begin_inset Newline newline
\end_inset
2002-06-11 14:22:42 +00:00
Boston MA 02111-1307
2024-06-23 09:01:39 +00:00
\begin_inset Newline newline
\end_inset
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
USA
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Lowertitleback
Copyright © 2002-2003 Bill Currie and Jeff Teunissen
\end_layout
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
\begin_inset CommandInset toc
LatexCommand tableofcontents
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\end_inset
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Addchap
2002-06-11 14:22:42 +00:00
Preface
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
In December 1996,
Id Software released
\emph on
2002-06-11 14:22:42 +00:00
Quake
2024-06-23 09:01:39 +00:00
\emph default
2002-06-11 14:22:42 +00:00
to the world.
2024-06-23 09:01:39 +00:00
It's doubtful that they knew at the time that it would spark a revolution – but such a revolution happened.
To the game industry's surprise,
people were getting the game not just to play it,
but to
\emph on
2002-06-11 14:22:42 +00:00
change
2024-06-23 09:01:39 +00:00
\emph default
it\SpecialChar endofsentence
For the first time,
people could make whole new games based on the Quake engine without having to rewrite the whole game – and in fact you couldn't rewrite the whole game,
because the main source code wasn't available to the general public.
2002-06-11 14:22:42 +00:00
What
2024-06-23 09:01:39 +00:00
\series bold
2002-06-11 14:22:42 +00:00
was
2024-06-23 09:01:39 +00:00
\series default
available was something new – the game wasn't just a game,
it was a virtual machine that had a byte-code instruction set – and it had a compiler that you could use to make new games to run inside that engine.
2002-06-11 14:22:42 +00:00
The language (called
2024-06-23 09:01:39 +00:00
\emph on
2002-06-11 14:22:42 +00:00
QuakeC
2024-06-23 09:01:39 +00:00
\emph default
) was kind of crude,
and the compiler was even more crude – but it was a revolutionary development.
\end_layout
\begin_layout Standard
Now,
let's fast-forward to another December – this time,
three years later.
In another revolutionary move,
Id Software released the source code to the complete Quake engine.
2002-06-11 14:22:42 +00:00
This gave many people the opportunity to do a lot more than just make
\begin_inset Quotes eld
2024-06-23 09:01:39 +00:00
\end_inset
2002-06-11 14:22:42 +00:00
mods
\begin_inset Quotes erd
2024-06-23 09:01:39 +00:00
\end_inset
2002-06-11 14:22:42 +00:00
for Quake.
2024-06-23 09:01:39 +00:00
Instead,
people could make all-new games without using Quake itself.
Many projects started up around this source code,
with many aims\SpecialChar ldots
but one project grew to be the most dominant:
That project is
\emph on
2002-06-11 14:22:42 +00:00
QuakeForge
2024-06-23 09:01:39 +00:00
\emph default
2002-06-10 06:18:59 +00:00
.
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 16:10:44 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
QuakeForge has developed a number of interesting things involving the Quake engine,
but most of them are beyond the scope of this manual.
2002-06-11 14:22:42 +00:00
This manual documents the
2024-06-23 09:01:39 +00:00
\emph on
2002-06-11 14:22:42 +00:00
Ruamoko
2003-02-18 20:08:05 +00:00
\begin_inset Foot
2024-06-23 09:01:39 +00:00
status collapsed
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
The name Ruamoko comes from the Maori name for their god of volcanoes and earthquakes.
According to myth,
Ruamoko is not yet born,
and when he shakes inside the Earth-mother,
the world trembles.
\end_layout
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\emph default
language,
a language based on Id Software's QuakeC,
but which has been expanded in ways far beyond the original language.
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
The idea behind this book is to give new programmers a solid foundation in both of the programming models (procedural and object-oriented) supported by the Ruamoko language,
while giving experienced Ruamoko programmers a complete reference for development of game code.
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
2003-02-18 20:08:05 +00:00
\begin_inset FloatList figure
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Part
2003-02-18 20:08:05 +00:00
Classical Programming in Ruamoko
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Chapter
\begin_inset CommandInset label
LatexCommand label
name "cha:A-Tutorial-Introduction"
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
Introduction:
Foot,
Meet Mister Rocket Launcher
\end_layout
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
2002-06-11 14:22:42 +00:00
Let us begin with a quick introduction to Ruamoko.
Our aim here is to show the basic elements of the language in real programs,
but without getting bogged down in details or rules.
2024-06-23 09:01:39 +00:00
At this point,
we're not even trying to be complete,
or even precise (except that the examples are meant to be correct).
We want to get you as quickly as possible to the point where you can write useful programs,
and to do that we have to concentrate on the basics:
variables and constants,
arithmetic,
flow control,
functions,
and the rudiments of input and output.
We are intentionally leaving out of this chapter features of Ruamoko that are important for writing bigger programs,
or programs to run in an actual Quake engine.
These include entities,
structures,
pointers,
most of the operators,
objects,
2002-06-11 14:22:42 +00:00
and the standard builtin library.
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
2002-06-11 14:22:42 +00:00
This approach has its drawbacks.
2024-06-23 09:01:39 +00:00
Most notable is that the complete story on any particular language feature is not found here,
and the brief tutorial,
just by being brief,
may be misleading.
And because the examples don't use the full power of Ruamoko,
they may not be as elegant or concise as they could be;
we
\series bold
2002-06-11 14:22:42 +00:00
have
2024-06-23 09:01:39 +00:00
\series default
tried to minimize these effects,
but be warned.
Another drawback is that later chapters will repeat some of what's presented here.
2002-06-11 14:22:42 +00:00
We hope that the repetition will help more than it annoys.
2024-06-23 09:01:39 +00:00
\end_layout
\begin_layout Standard
In any case,
experienced programmers should be able to get an idea,
from this chapter,
of some of the things that can be done in Ruamoko,
for their own needs.
Beginners should supplement it by writing small,
similar programs of their own.
Both groups can use it as a framework on which to hang the more detailed descriptions that begin in later chapters.
\end_layout
\begin_layout Section
2002-06-11 14:22:42 +00:00
Getting Started
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
The best way to learn a new programming language is by writing programs in it.
2002-06-11 14:22:42 +00:00
The first program one writes is almost always the same for all new languages:
print the phrase
\begin_inset Quotes eld
2024-06-23 09:01:39 +00:00
\end_inset
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
Hello,
world!
2002-06-11 14:22:42 +00:00
\begin_inset Quotes erd
2024-06-23 09:01:39 +00:00
\end_inset
2002-06-11 14:22:42 +00:00
on the screen.
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
2002-06-11 14:22:42 +00:00
This is the big hurdle.
2024-06-23 09:01:39 +00:00
To get past it,
you have to be able to create the program text somewhere,
compile it,
load it successfully,
load it,
run it,
and find out where the output went.
With these mechanical details mastered,
everything else is relatively easy.
\end_layout
\begin_layout Standard
2003-02-18 20:08:05 +00:00
\begin_inset Float figure
2024-06-23 09:01:39 +00:00
placement document
alignment document
2003-02-18 20:08:05 +00:00
wide false
2024-06-23 09:01:39 +00:00
sideways false
status collapsed
\begin_layout Plain Layout
\noindent
\begin_inset CommandInset line
LatexCommand rule
offset "0.5ex"
width "100line%"
height "1pt"
\end_inset
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_inset ERT
status collapsed
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\backslash
vspace{-1
\backslash
parskip}
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_inset
\end_layout
\begin_layout LyX-Code
\begin_inset CommandInset include
LatexCommand verbatiminput
filename "hello.r"
literal "true"
\end_inset
\end_layout
\begin_layout Plain Layout
\noindent
\begin_inset CommandInset line
LatexCommand rule
offset "0.5ex"
width "100line%"
height "1pt"
\end_inset
\end_layout
\begin_layout Plain Layout
\begin_inset Caption Standard
\begin_layout Plain Layout
\begin_inset CommandInset label
LatexCommand label
name "cap:Hello-World"
\end_inset
2003-02-18 20:08:05 +00:00
2002-06-11 14:22:42 +00:00
\begin_inset Quotes eld
2024-06-23 09:01:39 +00:00
\end_inset
2002-06-11 14:22:42 +00:00
2003-02-18 20:08:05 +00:00
Hello World
2002-06-11 14:22:42 +00:00
\begin_inset Quotes erd
2024-06-23 09:01:39 +00:00
\end_inset
\end_layout
\end_inset
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\end_inset
2002-06-11 14:22:42 +00:00
2003-02-18 20:08:05 +00:00
A Ruamoko program that does this simple task is found in Figure
2024-06-23 09:01:39 +00:00
\begin_inset CommandInset ref
LatexCommand vref
reference "cap:Hello-World"
nolink "false"
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_inset
2002-06-11 14:22:42 +00:00
2003-02-18 20:08:05 +00:00
.
2024-06-23 09:01:39 +00:00
To run this program,
you first have to compile it.
To compile it,
you need to save the source code into a file (for example,
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-11 14:22:42 +00:00
hello.r
2024-06-23 09:01:39 +00:00
\family default
),
then compile it with the command
\family typewriter
\series bold
2003-02-18 20:08:05 +00:00
qfcc -o qwaq.dat hello.r
2024-06-23 09:01:39 +00:00
\family default
\series default
2003-02-18 20:08:05 +00:00
.
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
If you haven't screwed anything up,
such as omitting a character or misspelling something,
the compilation will proceed.
You should be rewarded with something that looks something like Figure
\begin_inset CommandInset ref
LatexCommand vref
reference "cap:qfcc-output"
nolink "false"
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
.
\begin_inset Float figure
2024-06-23 09:01:39 +00:00
placement document
alignment document
2003-02-18 20:08:05 +00:00
wide false
2024-06-23 09:01:39 +00:00
sideways false
status collapsed
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout LyX-Code
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_inset CommandInset include
LatexCommand verbatiminput
filename "qfcc-output.txt"
literal "true"
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
\begin_inset Caption Standard
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
\begin_inset CommandInset label
LatexCommand label
name "cap:qfcc-output"
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\series bold
2003-02-18 20:08:05 +00:00
qfcc
2024-06-23 09:01:39 +00:00
\family default
\series default
2003-02-18 20:08:05 +00:00
output
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\end_layout
\begin_layout Standard
2003-02-18 20:08:05 +00:00
You run
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-11 14:22:42 +00:00
qwaq.dat
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
by issuing the command
2024-06-23 09:01:39 +00:00
\family typewriter
\series bold
2003-02-18 20:08:05 +00:00
qwaq
2024-06-23 09:01:39 +00:00
\family default
\series default
2003-02-18 20:08:05 +00:00
.
The program should print
\begin_inset Quotes eld
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
Hello,
world!
\family default
2003-02-18 20:08:05 +00:00
\begin_inset Quotes erd
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
to your screen.
2024-06-23 09:01:39 +00:00
\end_layout
\begin_layout Standard
Now,
for some explanations regarding the program itself.
All Ruamoko programs,
regardless of size,
consist mainly of
\emph on
2003-02-18 20:08:05 +00:00
functions
2024-06-23 09:01:39 +00:00
\emph default
2003-02-18 20:08:05 +00:00
and
2024-06-23 09:01:39 +00:00
\emph on
2003-02-18 20:08:05 +00:00
variables
2024-06-23 09:01:39 +00:00
\emph default
2003-02-18 20:08:05 +00:00
.
2024-06-23 09:01:39 +00:00
A function contains statements that tell the compiler what computing operations you want to do,
and variables store values used during the operation of the program.
Ruamoko functions are roughly equivalent to C's functions,
or Pascal's procedures and functions.
2003-02-18 20:08:05 +00:00
Our example is a function called
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
main
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
.
2024-06-23 09:01:39 +00:00
You can create functions with just about any name you like,
but
2003-02-18 20:08:05 +00:00
\begin_inset Quotes eld
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
main
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
\begin_inset Quotes erd
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
is special – program execution begins there
2003-02-18 20:08:05 +00:00
\begin_inset Foot
2024-06-23 09:01:39 +00:00
status collapsed
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2003-02-18 20:08:05 +00:00
This is not precisely true.
2024-06-23 09:01:39 +00:00
When used in a game engine,
there are certain other functions that are called by the engine during the course of a game.
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
.
This means that every program must have a
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
main
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
function somewhere.
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
The main function will usually call other functions to do its job – some of them you write,
and some of them are provided by the virtual machine your program runs inside.
2003-02-18 20:08:05 +00:00
The first lines of the program (the ones beginning with
\begin_inset Quotes eld
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
#include
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
\begin_inset Quotes erd
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
) tell the compiler to include information about the standard variables,
2024-06-23 09:01:39 +00:00
constants,
\emph on
2003-02-18 20:08:05 +00:00
fields
2024-06-23 09:01:39 +00:00
\emph default
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_inset Index idx
range none
pageformat default
status collapsed
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
fields
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_inset
,
and
\emph on
2003-02-18 20:08:05 +00:00
engine functions
\begin_inset Foot
2024-06-23 09:01:39 +00:00
status collapsed
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2003-02-18 20:08:05 +00:00
also known as
2024-06-23 09:01:39 +00:00
\emph on
2003-02-18 20:08:05 +00:00
builtins
2024-06-23 09:01:39 +00:00
\emph default
2003-02-18 20:08:05 +00:00
.
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\emph default
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_inset Index idx
range none
pageformat default
status collapsed
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
functions,
engine
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
provided by the environment
\begin_inset Foot
2024-06-23 09:01:39 +00:00
status collapsed
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2003-02-18 20:08:05 +00:00
The environment will be described later.
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
.
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
One way of communicating data between functions is for the calling function to provide a list of values,
called
\emph on
2003-02-18 20:08:05 +00:00
arguments
2024-06-23 09:01:39 +00:00
\emph default
\begin_inset Index idx
range none
pageformat default
status collapsed
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
arguments
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
,
to the function it calls.
2003-02-18 20:08:05 +00:00
The parentheses after the function's name surround the
2024-06-23 09:01:39 +00:00
\emph on
2003-02-18 20:08:05 +00:00
argument list
2024-06-23 09:01:39 +00:00
\emph default
\begin_inset Index idx
range none
pageformat default
status collapsed
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
argument list
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
.
2024-06-23 09:01:39 +00:00
In this example,
main is defined to be a function that expects no arguments,
which is indicated by an empty list:
\begin_inset space ~
\end_inset
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
()
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
.
2024-06-23 09:01:39 +00:00
\end_layout
\begin_layout Standard
The statements of a function are enclosed in curly braces,
\begin_inset space ~
\end_inset
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
{}
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
.
The function
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
main
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
contains only one statement,
2024-06-23 09:01:39 +00:00
\family typewriter
printf ("Hello,
world!
\backslash
2003-02-18 20:08:05 +00:00
n")
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
.
This is a
2024-06-23 09:01:39 +00:00
\emph on
2003-02-18 20:08:05 +00:00
function call
2024-06-23 09:01:39 +00:00
\emph default
,
which transfers control from one function to another.
A function is called by giving its name,
followed by a list of arguments enclosed by parentheses,
so this calls the function
\family typewriter
2003-02-18 20:08:05 +00:00
printf
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
with the argument
2024-06-23 09:01:39 +00:00
\family typewriter
"Hello,
world!
\backslash
2003-02-18 20:08:05 +00:00
n"
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
.
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
printf
2024-06-23 09:01:39 +00:00
\family default
is an engine function that prints output,
in this case the string of characters between the quotes.
\end_layout
\begin_layout Standard
A sequence of characters between double quotes,
like
\family typewriter
"Hello,
world!
\backslash
2003-02-18 20:08:05 +00:00
n"
2024-06-23 09:01:39 +00:00
\family default
,
is called a
\emph on
2003-02-18 20:08:05 +00:00
string constant
2024-06-23 09:01:39 +00:00
\emph default
2003-02-18 20:08:05 +00:00
or simply a
2024-06-23 09:01:39 +00:00
\emph on
2003-02-18 20:08:05 +00:00
string
2024-06-23 09:01:39 +00:00
\emph default
2003-02-18 20:08:05 +00:00
.
2024-06-23 09:01:39 +00:00
For the moment,
our only use of strings will be as arguments for
\family typewriter
2003-02-18 20:08:05 +00:00
printf
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
and other functions.
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
2003-02-18 20:08:05 +00:00
The sequence
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\backslash
2003-02-18 20:08:05 +00:00
n
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
in the string is Ruamoko notation for the
2024-06-23 09:01:39 +00:00
\emph on
2003-02-18 20:08:05 +00:00
newline character
2024-06-23 09:01:39 +00:00
\emph default
,
which when printed tells the terminal (or a game client) to advance to the next line in the output.
2003-02-18 20:08:05 +00:00
If you leave out the
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\backslash
2003-02-18 20:08:05 +00:00
n
2024-06-23 09:01:39 +00:00
\family default
,
you will find that there is no advance after the character string is printed.
2003-02-18 20:08:05 +00:00
You must use
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\backslash
2003-02-18 20:08:05 +00:00
n
2024-06-23 09:01:39 +00:00
\family default
to include a newline character in the printf argument;
if you try to insert a newline yourself into the string,
the Ruamoko compiler will give you an error message when you compile the program.
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
2003-02-18 20:08:05 +00:00
\begin_inset Float figure
2024-06-23 09:01:39 +00:00
placement document
alignment document
2003-02-18 20:08:05 +00:00
wide false
2024-06-23 09:01:39 +00:00
sideways false
status collapsed
\begin_layout Plain Layout
\noindent
\begin_inset CommandInset line
LatexCommand rule
offset "0.5ex"
width "100line%"
height "1pt"
\end_inset
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
vspace{-1
\backslash
parskip}
\end_layout
\begin_layout Plain Layout
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout LyX-Code
\begin_inset CommandInset include
LatexCommand verbatiminput
filename "hello2.r"
literal "true"
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
\noindent
\begin_inset CommandInset line
LatexCommand rule
offset "0.5ex"
width "100line%"
height "1pt"
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_inset
\end_layout
\begin_layout Plain Layout
\begin_inset Caption Standard
\begin_layout Plain Layout
\begin_inset CommandInset label
LatexCommand label
name "cap:A-different-Hello"
\end_inset
2003-02-18 20:08:05 +00:00
A different
\begin_inset Quotes eld
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
Hello World
\begin_inset Quotes erd
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
The
\family typewriter
printf()
\family default
function never supplies a newline automatically,
so several calls may be used to build up an output line in stages.
Our first program could just as easily been written as it is in figure
\begin_inset CommandInset ref
LatexCommand vref
reference "cap:A-different-Hello"
nolink "false"
\end_inset
,
and it would have produced identical output.
\end_layout
\begin_layout Standard
2003-02-18 20:08:05 +00:00
Note that
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\backslash
2003-02-18 20:08:05 +00:00
n
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
represents only a single character.
An
2024-06-23 09:01:39 +00:00
\emph on
2003-02-18 20:08:05 +00:00
escape character
2024-06-23 09:01:39 +00:00
\emph default
2003-02-18 20:08:05 +00:00
like
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\backslash
2003-02-18 20:08:05 +00:00
n
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
gives you a general way to express hard-to-type or invisible characters.
Among the others are
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\backslash
2003-02-18 20:08:05 +00:00
t
2024-06-23 09:01:39 +00:00
\family default
for a tab,
\family typewriter
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\backslash
2003-02-18 20:08:05 +00:00
b
2024-06-23 09:01:39 +00:00
\family default
for a backspace,
\family typewriter
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\backslash
2003-02-18 20:08:05 +00:00
"
2024-06-23 09:01:39 +00:00
\family default
for a double-quote,
and
\family typewriter
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\backslash
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\backslash
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
for the backslash character itself.
There is a complete list in [section]
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Section
2003-02-18 20:08:05 +00:00
Variables and Mathematical Expressions
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
2003-02-18 20:08:05 +00:00
\begin_inset Float figure
2024-06-23 09:01:39 +00:00
placement document
alignment document
2003-02-18 20:08:05 +00:00
wide false
2024-06-23 09:01:39 +00:00
sideways false
status collapsed
\begin_layout Plain Layout
\noindent
\begin_inset CommandInset line
LatexCommand rule
offset "0.5ex"
width "100line%"
height "1pt"
\end_inset
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
\backslash
vspace{-1
\backslash
parskip}
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout LyX-Code
\begin_inset CommandInset include
LatexCommand verbatiminput
filename "radians.r"
literal "true"
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_layout
\begin_layout Plain Layout
\noindent
\begin_inset CommandInset line
LatexCommand rule
offset "0.5ex"
width "100line%"
height "1pt"
\end_inset
\end_layout
\begin_layout Plain Layout
\begin_inset Caption Standard
\begin_layout Plain Layout
\begin_inset CommandInset label
LatexCommand label
name "cap:Degrees-to-radians"
\end_inset
2003-02-18 20:08:05 +00:00
Degrees to radians
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
In figure
2024-06-23 09:01:39 +00:00
\begin_inset CommandInset ref
LatexCommand vref
reference "cap:Degrees-to-radians"
nolink "false"
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
,
we find a simple program uses the formula
2004-04-28 00:43:03 +00:00
\begin_inset Formula $R=D\,\times\,(\frac{\pi}{180})$
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
to print a table of various angles in both their degrees and radian equivalents.
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
2003-02-18 20:08:05 +00:00
The line
\begin_inset Quotes eld
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
/* Print a silly conversion table between degrees and radians */
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
\begin_inset Quotes erd
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
and the three parts that say things like
\begin_inset Quotes eld
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
// lower limit
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
\begin_inset Quotes erd
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
are
2024-06-23 09:01:39 +00:00
\emph on
2003-02-18 20:08:05 +00:00
comments
2024-06-23 09:01:39 +00:00
\emph default
\begin_inset Index idx
range none
pageformat default
status collapsed
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
comments
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
.
Characters between
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
/*
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
and
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
*/
2024-06-23 09:01:39 +00:00
\family default
,
and anything between
\family typewriter
2003-02-18 20:08:05 +00:00
//
2024-06-23 09:01:39 +00:00
\family default
and the next line,
are ignored by the compiler;
they may be used freely to make a program easier for humans to understand.
Comments may appear anywhere a blank space,
or a tab,
or a newline can.
\end_layout
\begin_layout Standard
In Ruamoko,
all variables must be declared before they are used.,
usually at the beginning of the function before any statements.
2003-02-18 20:08:05 +00:00
A declaration
2024-06-23 09:01:39 +00:00
\begin_inset Index idx
range none
pageformat default
status collapsed
\begin_layout Plain Layout
declaration,
variable
\end_layout
\end_inset
announces the properties of variables to the compiler;
it consists of a type name and a list of one or more variables,
such as
\end_layout
\begin_layout LyX-Code
float degrees,
radians;
\begin_inset Newline newline
\end_inset
integer lower,
upper,
step;
\end_layout
\begin_layout Standard
2003-02-18 20:08:05 +00:00
The type
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
float
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
means that the
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
degrees
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
and
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
radians
2024-06-23 09:01:39 +00:00
\family default
variables are floating-point numbers (numbers that can have a fractional part),
and the type
\family typewriter
2003-02-18 20:08:05 +00:00
integer
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
means that the
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
lower
2024-06-23 09:01:39 +00:00
\family default
,
\family typewriter
2003-02-18 20:08:05 +00:00
upper
2024-06-23 09:01:39 +00:00
\family default
,
and
\family typewriter
2003-02-18 20:08:05 +00:00
step
2024-06-23 09:01:39 +00:00
\family default
variables are integers – that is,
they are whole numbers.
\end_layout
\begin_layout Standard
Unlike C,
in which
\family typewriter
2003-02-18 20:08:05 +00:00
int
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
and
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
float
2024-06-23 09:01:39 +00:00
\family default
can have different sizes depending on the machine,
Ruamoko variables always have a size that is a multiple of 4 bytes (32 bits).
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
2003-02-18 20:08:05 +00:00
Ruamoko provides four basic data types
2024-06-23 09:01:39 +00:00
\begin_inset Index idx
range none
pageformat default
status collapsed
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
types,
basic
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
:
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
\begin_inset Tabular
2003-02-18 20:08:05 +00:00
<lyxtabular version="3" rows="4" columns="2">
2024-06-23 09:01:39 +00:00
<features tabularvalignment="middle">
2003-02-18 20:08:05 +00:00
<column alignment="left" valignment="top" width="0pt">
<column alignment="left" valignment="top" width="0pt">
<row>
2024-06-23 09:01:39 +00:00
<cell alignment="center" valignment="top" usebox="none">
2003-02-18 20:08:05 +00:00
\begin_inset Text
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
float
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
</cell>
2024-06-23 09:01:39 +00:00
<cell alignment="center" valignment="top" usebox="none">
2003-02-18 20:08:05 +00:00
\begin_inset Text
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2003-02-18 20:08:05 +00:00
floating-point numbers
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
</cell>
</row>
<row>
2024-06-23 09:01:39 +00:00
<cell alignment="center" valignment="top" usebox="none">
2003-02-18 20:08:05 +00:00
\begin_inset Text
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
integer
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
</cell>
2024-06-23 09:01:39 +00:00
<cell alignment="center" valignment="top" usebox="none">
2003-02-18 20:08:05 +00:00
\begin_inset Text
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
2003-02-18 20:08:05 +00:00
\color none
2024-06-23 09:01:39 +00:00
whole numbers,
with a range between -2147483648 and 2147483647.
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
</cell>
</row>
<row>
2024-06-23 09:01:39 +00:00
<cell alignment="center" valignment="top" usebox="none">
2003-02-18 20:08:05 +00:00
\begin_inset Text
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
string
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
</cell>
2024-06-23 09:01:39 +00:00
<cell alignment="center" valignment="top" usebox="none">
2003-02-18 20:08:05 +00:00
\begin_inset Text
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
2003-02-18 20:08:05 +00:00
\color none
text strings
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
</cell>
</row>
<row>
2024-06-23 09:01:39 +00:00
<cell alignment="center" valignment="top" usebox="none">
2003-02-18 20:08:05 +00:00
\begin_inset Text
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
vector
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
</cell>
2024-06-23 09:01:39 +00:00
<cell alignment="center" valignment="top" usebox="none">
2003-02-18 20:08:05 +00:00
\begin_inset Text
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\family roman
\series medium
\shape up
\size normal
\emph off
\bar no
\noun off
2003-02-18 20:08:05 +00:00
\color none
three-dimensional floating-point vectors
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
</cell>
</row>
</lyxtabular>
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
There are more types than just these four,
but this is the list of
\emph on
2003-02-18 20:08:05 +00:00
basic types
2024-06-23 09:01:39 +00:00
\emph default
2003-02-18 20:08:05 +00:00
.
There are also
2024-06-23 09:01:39 +00:00
\emph on
2003-02-18 20:08:05 +00:00
arrays
2024-06-23 09:01:39 +00:00
\emph default
,
\emph on
2003-02-18 20:08:05 +00:00
structures
2024-06-23 09:01:39 +00:00
\emph default
,
and
\emph on
2003-02-18 20:08:05 +00:00
unions
2024-06-23 09:01:39 +00:00
\emph default
of these basic types,
\emph on
2003-02-18 20:08:05 +00:00
pointers
2024-06-23 09:01:39 +00:00
\emph default
to them,
and functions that return them,
all of which we'll meet later.
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
2003-02-18 20:08:05 +00:00
The computation in the conversion program begins with the assignment statements
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout LyX-Code
2003-02-18 20:08:05 +00:00
lower = 0;
2024-06-23 09:01:39 +00:00
\begin_inset Newline newline
\end_inset
2003-02-18 20:08:05 +00:00
upper = 360;
2024-06-23 09:01:39 +00:00
\begin_inset Newline newline
\end_inset
2003-02-18 20:08:05 +00:00
step = 45;
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
2003-02-18 20:08:05 +00:00
which set the variables to their initial values.
2024-06-23 09:01:39 +00:00
In Ruamoko,
as in C,
a statement is terminated by the semicolon character.
\end_layout
\begin_layout Standard
Each line of the table is computed in the same manner,
so we use a loop that repeats once per output line;
this is the purpose of the
\family typewriter
2003-02-18 20:08:05 +00:00
while
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
loop
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout LyX-Code
2003-02-18 20:08:05 +00:00
while (degrees <= upper) {
2024-06-23 09:01:39 +00:00
\begin_inset Newline newline
\end_inset
2003-02-18 20:08:05 +00:00
2004-04-28 00:43:03 +00:00
\begin_inset Formula $\vdots$
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_inset Newline newline
\end_inset
2003-02-18 20:08:05 +00:00
}
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
2003-02-18 20:08:05 +00:00
The
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
while
2024-06-23 09:01:39 +00:00
\family default
loop works like this:
The condition in parentheses is tested.
2003-02-18 20:08:05 +00:00
If it is true (if
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
degrees
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
is less than or equal to
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
upper
2024-06-23 09:01:39 +00:00
\family default
),
the body of the loop (the three statements enclosed in the block delimited by the curly braces) is executed.
Then the condition is tested again,
and if it's true again,
the body is executed again.
2003-02-18 20:08:05 +00:00
If and when the condition becomes false (
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
degrees
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
exceeds
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
upper
2024-06-23 09:01:39 +00:00
\family default
),
the loop ends and execution continues at the statement following the loop's end.
Since there are no more statements in the program,
the end of the loop terminates the program.
\end_layout
\begin_layout Standard
The body of a while loop can be one or more statements enclosed in braces (called a block,
or compound statement),
or a single statement without braces,
as in
\end_layout
\begin_layout LyX-Code
2003-02-18 20:08:05 +00:00
while (i < n)
2024-06-23 09:01:39 +00:00
\begin_inset Newline newline
\end_inset
2003-02-18 20:08:05 +00:00
i = i * 2;
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
In either case,
we will always indent the statements controlled by the while by one tab stop (which we will show as four spaces),
so you can see at a glance which statements are inside the loop.
2003-02-18 20:08:05 +00:00
The indentation emphasizes the logical structure of the program.
2024-06-23 09:01:39 +00:00
The compiler does not care how your program looks,
but proper indentation and spacing are critical in making programs easy for people (including you) to read.
We recommend writing only one statement per line,
and using blanks around operators to make groupings clear.
The positions of braces is less important,
though you should be warned that many programmers have passionate beliefs about how braces should be used.
2003-02-18 20:08:05 +00:00
We have chosen the so-called
\begin_inset Quotes eld
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
One True Brace Style
\begin_inset Quotes erd
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
,
which is the style that Brian Kernighan and Dennis Ritchie used in their book
\bar under
2003-02-18 20:08:05 +00:00
The C Programming Language
2024-06-23 09:01:39 +00:00
\bar default
,
for consistency.
Pick a style that suits you,
and use it consistently in your own work,
but be prepared to adapt to the styles of other programmers when writing as a group.
\end_layout
\begin_layout Standard
2003-02-18 20:08:05 +00:00
Most of the work gets done inside the loop.
The radians for the angle are computed and assigned to the
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
radians
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
variable using the statement
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout LyX-Code
2003-02-18 20:08:05 +00:00
radians = degrees * (PI / 180);
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
2003-02-18 20:08:05 +00:00
This example also shows a bit more of how
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
printf()
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
works.
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
printf()
2024-06-23 09:01:39 +00:00
\family default
is a general-purpose output formatting function,
which we will describe in detail in [chapter].
Its first argument is a string to be printed,
with each
\family typewriter
2003-02-18 20:08:05 +00:00
%
2024-06-23 09:01:39 +00:00
\family default
indicating where one of the other (second,
third,
and so on) arguments is to be substituted,
and in what form it is to be output.
For instance,
\family typewriter
2003-02-18 20:08:05 +00:00
%f
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
specifies a
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
float
2024-06-23 09:01:39 +00:00
\family default
argument,
so the statement
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout LyX-Code
2003-02-18 20:08:05 +00:00
printf("%f
2024-06-23 09:01:39 +00:00
\backslash
2003-02-18 20:08:05 +00:00
t%f
2024-06-23 09:01:39 +00:00
\backslash
n",
degrees,
radians);
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
2003-02-18 20:08:05 +00:00
causes the values of the two
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
float
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
variables
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
degrees
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
and
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
radians
2024-06-23 09:01:39 +00:00
\family default
to be printed,
with a tab (
\family typewriter
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\backslash
2003-02-18 20:08:05 +00:00
t
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
) between them.
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Chapter
Types,
Operators,
and Expressions
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
2003-02-18 20:08:05 +00:00
Variables and constants are the basic data units manipulated in a program.
2024-06-23 09:01:39 +00:00
Declarations list the variables to be used,
and state what type they have and perhaps what the initial values for them are.
2003-02-18 20:08:05 +00:00
Operators specify what is to be done to them.
Expressions combine variables and constants to produce new values.
2024-06-23 09:01:39 +00:00
The type of a unit determines the set of values it can have and what operations are permissible for it.
2003-02-18 20:08:05 +00:00
These building blocks are the subject of this chapter.
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Section
2003-02-18 20:08:05 +00:00
Variable Names
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
2003-02-18 20:08:05 +00:00
Though we didn't say it in Chapter
2024-06-23 09:01:39 +00:00
\begin_inset CommandInset ref
LatexCommand ref
reference "cha:A-Tutorial-Introduction"
nolink "false"
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
,
there are some restrictions on variable names and symbolic constants.
Names are composed of letters and digits;
the first character must be a letter (the underscore,
2003-02-18 20:08:05 +00:00
\begin_inset Quotes eld
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
_
\begin_inset Quotes erd
2024-06-23 09:01:39 +00:00
\end_inset
,
counts as a letter – it's often useful for improving the readability of long names).
Don't begin variable names with an underscore,
however,
since functions beginning with _ are reserved for library and engine functions.
Upper-case and lower-case are distinct,
so x and X are two different names.
2003-02-18 20:08:05 +00:00
Traditional practice is to use lower-case or mixed case for variable names,
and all upper-case for
2024-06-23 09:01:39 +00:00
\emph on
2003-02-18 20:08:05 +00:00
symbolic constants
2024-06-23 09:01:39 +00:00
\emph default
,
also known as
\emph on
2003-02-18 20:08:05 +00:00
defines
2024-06-23 09:01:39 +00:00
\emph default
2003-02-18 20:08:05 +00:00
.
2024-06-23 09:01:39 +00:00
Keywords like if,
else,
integer,
float,
etc.
are reserved – you can't use them as variable names.
\end_layout
\begin_layout Section
2003-02-18 20:08:05 +00:00
Constants
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
2003-02-18 20:08:05 +00:00
An integer constant like
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
5678
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
is an integer.
Floating-point constants contain a decimal point (
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
123.4
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
) or an exponent (
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
1e-2
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
) or both (
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
1.2e3
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
).
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
The value of an integer can be specified in octal (base 8,
0
2004-04-28 00:43:03 +00:00
\begin_inset Formula $\ldots$
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
7) or hexadecimal (base 16,
0
2004-04-28 00:43:03 +00:00
\begin_inset Formula $\ldots$
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
F,
hereafter called
2003-02-18 20:08:05 +00:00
\begin_inset Quotes eld
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
hex
\begin_inset Quotes erd
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
) instead of decimal.
A leading
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
0
2024-06-23 09:01:39 +00:00
\family default
(zero) on an integer constant means octal;
a leading
\family typewriter
2003-02-18 20:08:05 +00:00
0x
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
or
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
0X
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
means hex.
2024-06-23 09:01:39 +00:00
For example,
decimal 31 can be written as
\family typewriter
2003-02-18 20:08:05 +00:00
037
2024-06-23 09:01:39 +00:00
\family default
in octal,
or
\family typewriter
2003-02-18 20:08:05 +00:00
0x1f
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
or
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
0X1F
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
in hex.
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
Certain characters can be represented in string constants by escape sequences like
\family typewriter
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\backslash
2003-02-18 20:08:05 +00:00
n
2024-06-23 09:01:39 +00:00
\family default
(newline);
these sequences look like two characters,
but represent only one.
In addition,
an arbitrary byte value can be represented by
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout LyX-Code
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\backslash
2003-02-18 20:08:05 +00:00
o
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
2003-02-18 20:08:05 +00:00
where
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
o
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
is one to three octal digits or by
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout LyX-Code
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\backslash
2003-02-18 20:08:05 +00:00
xh
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
2003-02-18 20:08:05 +00:00
where
2024-06-23 09:01:39 +00:00
\family typewriter
2003-02-18 20:08:05 +00:00
h
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
is one or more hex digits.
So we might write
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout LyX-Code
2003-02-18 20:08:05 +00:00
"vtab =
2024-06-23 09:01:39 +00:00
\backslash
2003-02-18 20:08:05 +00:00
013"
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
or,
in hex,
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout LyX-Code
2003-02-18 20:08:05 +00:00
"vtab =
2024-06-23 09:01:39 +00:00
\backslash
2003-02-18 20:08:05 +00:00
x0b"
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
2003-02-18 20:08:05 +00:00
The complete set of escape sequences is found in Table
2024-06-23 09:01:39 +00:00
\begin_inset CommandInset ref
LatexCommand ref
reference "cap:Escape-sequences"
nolink "false"
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
.
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
2003-02-18 20:08:05 +00:00
\begin_inset Float table
2024-06-23 09:01:39 +00:00
placement document
alignment document
2003-02-18 20:08:05 +00:00
wide false
2024-06-23 09:01:39 +00:00
sideways false
status collapsed
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
\begin_inset space \hfill{}
\end_inset
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_inset Tabular
2003-02-18 20:08:05 +00:00
<lyxtabular version="3" rows="14" columns="2">
2024-06-23 09:01:39 +00:00
<features tabularvalignment="middle">
<column alignment="left" valignment="top" width="0pt">
<column alignment="left" valignment="top" width="0pt">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2003-02-18 20:08:05 +00:00
\begin_inset Text
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2003-02-18 20:08:05 +00:00
Sequence
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
</cell>
2024-06-23 09:01:39 +00:00
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
2003-02-18 20:08:05 +00:00
\begin_inset Text
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2003-02-18 20:08:05 +00:00
Description
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
</cell>
</row>
2024-06-23 09:01:39 +00:00
<row>
2003-02-18 20:08:05 +00:00
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\backslash
2003-02-18 20:08:05 +00:00
a
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2003-02-18 20:08:05 +00:00
Alert (bell) character
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
</cell>
</row>
2024-06-23 09:01:39 +00:00
<row>
2003-02-18 20:08:05 +00:00
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\backslash
2003-02-18 20:08:05 +00:00
b
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2003-02-18 20:08:05 +00:00
backspace
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
</cell>
</row>
2024-06-23 09:01:39 +00:00
<row>
2003-02-18 20:08:05 +00:00
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\backslash
2003-02-18 20:08:05 +00:00
f
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2003-02-18 20:08:05 +00:00
form feed
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
</cell>
</row>
2024-06-23 09:01:39 +00:00
<row>
2003-02-18 20:08:05 +00:00
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\backslash
2003-02-18 20:08:05 +00:00
n
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2003-02-18 20:08:05 +00:00
newline
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
</cell>
</row>
2024-06-23 09:01:39 +00:00
<row>
2003-02-18 20:08:05 +00:00
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\backslash
2003-02-18 20:08:05 +00:00
r
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2003-02-18 20:08:05 +00:00
carriage return
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
</cell>
</row>
2024-06-23 09:01:39 +00:00
<row>
2003-02-18 20:08:05 +00:00
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
2002-06-10 16:10:44 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\backslash
2003-02-18 20:08:05 +00:00
t
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2003-02-18 20:08:05 +00:00
tab character
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
</cell>
</row>
2024-06-23 09:01:39 +00:00
<row>
2003-02-18 20:08:05 +00:00
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\backslash
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\backslash
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2003-02-18 20:08:05 +00:00
backslash
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
</cell>
</row>
2024-06-23 09:01:39 +00:00
<row>
2003-02-18 20:08:05 +00:00
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\backslash
2003-02-18 20:08:05 +00:00
?
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2003-02-18 20:08:05 +00:00
question mark
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
</cell>
</row>
2024-06-23 09:01:39 +00:00
<row>
2003-02-18 20:08:05 +00:00
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\backslash
2003-02-18 20:08:05 +00:00
'
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2003-02-18 20:08:05 +00:00
single quote
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
</cell>
</row>
2024-06-23 09:01:39 +00:00
<row>
2003-02-18 20:08:05 +00:00
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\backslash
2003-02-18 20:08:05 +00:00
"
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2003-02-18 20:08:05 +00:00
double quote
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
</cell>
</row>
2024-06-23 09:01:39 +00:00
<row>
2003-02-18 20:08:05 +00:00
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\backslash
2003-02-18 20:08:05 +00:00
ooo
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2003-02-18 20:08:05 +00:00
octal number
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
</cell>
</row>
2024-06-23 09:01:39 +00:00
<row>
2003-02-18 20:08:05 +00:00
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\backslash
2003-02-18 20:08:05 +00:00
xhh
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2003-02-18 20:08:05 +00:00
hex number
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
</cell>
</row>
2024-06-23 09:01:39 +00:00
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
2003-02-18 20:08:05 +00:00
\begin_inset Text
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\backslash
2003-02-18 20:08:05 +00:00
^
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
</cell>
2024-06-23 09:01:39 +00:00
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
2003-02-18 20:08:05 +00:00
\begin_inset Text
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
2003-02-18 20:08:05 +00:00
alternate character set (toggles)
2024-06-23 09:01:39 +00:00
\end_layout
\end_inset
2003-02-18 20:08:05 +00:00
</cell>
</row>
</lyxtabular>
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_inset space \hfill{}
\end_inset
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
\begin_inset Caption Standard
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Plain Layout
\begin_inset CommandInset label
LatexCommand label
name "cap:Escape-sequences"
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
Escape sequences
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_inset
\end_layout
\begin_layout Chapter
Control Constructs:
Kneel Before Zod
\end_layout
\begin_layout Chapter
Arrays and Pointers:
Pull Pin,
Then Throw
\bar under
2003-02-18 20:08:05 +00:00
GRENADE
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Chapter
Breaking Up The Program:
Now Where Did I Put That?
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Part
2003-02-18 20:08:05 +00:00
Object-Oriented Programming in Ruamoko
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Part
2002-06-11 14:22:42 +00:00
Language Reference
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Chapter
2003-02-18 20:08:05 +00:00
Types
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
2002-06-11 14:22:42 +00:00
This is currently just new stuff in
2024-06-23 09:01:39 +00:00
\family typewriter
\series bold
2002-06-11 14:22:42 +00:00
qfcc
2024-06-23 09:01:39 +00:00
\family default
\series default
2002-06-11 14:22:42 +00:00
.
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 04:28:24 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Section
2002-06-10 04:28:24 +00:00
New Type Features
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 04:28:24 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Subsection
2002-06-10 04:28:24 +00:00
New Types
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 04:28:24 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Labeling
\labelwidthstring 00.00.0000
2024-08-11 06:23:08 +00:00
\begin_inset Flex Code
status open
\begin_layout Plain Layout
int
\end_layout
\end_inset
2002-06-10 04:28:24 +00:00
32 bit signed integer
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 04:28:24 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Labeling
\labelwidthstring 00.00.0000
2024-08-11 06:23:08 +00:00
\begin_inset Flex Code
status open
2002-06-10 04:28:24 +00:00
2024-08-11 06:23:08 +00:00
\begin_layout Plain Layout
2002-06-10 04:28:24 +00:00
id
2024-08-11 06:23:08 +00:00
\end_layout
\end_inset
2002-06-10 04:28:24 +00:00
generic object pointer
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 04:28:24 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Labeling
\labelwidthstring 00.00.0000
2024-08-11 06:23:08 +00:00
\begin_inset Flex Code
status open
2002-06-10 04:28:24 +00:00
2024-08-11 06:23:08 +00:00
\begin_layout Plain Layout
2002-06-10 04:28:24 +00:00
Class
2024-08-11 06:23:08 +00:00
\end_layout
\end_inset
2002-06-10 04:28:24 +00:00
class object pointer
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 04:28:24 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Labeling
\labelwidthstring 00.00.0000
2024-08-11 06:23:08 +00:00
\begin_inset Flex Code
status open
2002-06-10 04:28:24 +00:00
2024-08-11 06:23:08 +00:00
\begin_layout Plain Layout
2002-06-10 04:28:24 +00:00
Protocol
2024-08-11 06:23:08 +00:00
\end_layout
\end_inset
2002-06-10 04:28:24 +00:00
protocol object pointer
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 04:28:24 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Labeling
\labelwidthstring 00.00.0000
2024-08-11 06:23:08 +00:00
\begin_inset Flex Code
status open
2002-06-10 04:28:24 +00:00
2024-08-11 06:23:08 +00:00
\begin_layout Plain Layout
2002-06-10 04:28:24 +00:00
Method
2024-08-11 06:23:08 +00:00
\end_layout
\end_inset
2002-06-10 04:28:24 +00:00
method pointer
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 04:28:24 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Labeling
\labelwidthstring 00.00.0000
2024-08-11 06:23:08 +00:00
\begin_inset Flex Code
status open
2002-06-10 04:28:24 +00:00
2024-08-11 06:23:08 +00:00
\begin_layout Plain Layout
2002-06-10 04:28:24 +00:00
SEL
2024-08-11 06:23:08 +00:00
\end_layout
\end_inset
2002-06-10 04:28:24 +00:00
selector
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 04:28:24 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Labeling
\labelwidthstring 00.00.0000
2024-08-11 06:23:08 +00:00
\begin_inset Flex Code
status open
2002-06-10 04:28:24 +00:00
2024-08-11 06:23:08 +00:00
\begin_layout Plain Layout
2002-06-10 04:28:24 +00:00
IMP
2024-08-11 06:23:08 +00:00
\end_layout
\end_inset
2002-06-11 14:22:42 +00:00
message implementation
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 04:28:24 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
2024-08-11 06:23:08 +00:00
\begin_inset Flex Code
status open
2002-06-10 04:28:24 +00:00
2024-08-11 06:23:08 +00:00
\begin_layout Plain Layout
2002-06-10 04:28:24 +00:00
id
2024-08-11 06:23:08 +00:00
\end_layout
\end_inset
2024-06-23 09:01:39 +00:00
,
2024-08-11 06:23:08 +00:00
\begin_inset Flex Code
status open
\begin_layout Plain Layout
2002-06-10 04:28:24 +00:00
Class
2024-08-11 06:23:08 +00:00
\end_layout
\end_inset
2024-06-23 09:01:39 +00:00
,
2024-08-11 06:23:08 +00:00
\begin_inset Flex Code
status open
\begin_layout Plain Layout
2002-06-10 04:28:24 +00:00
Protocol
2024-08-11 06:23:08 +00:00
\end_layout
\end_inset
2024-06-23 09:01:39 +00:00
,
2024-08-11 06:23:08 +00:00
\begin_inset Flex Code
status open
\begin_layout Plain Layout
2002-06-10 04:28:24 +00:00
Method
2024-08-11 06:23:08 +00:00
\end_layout
\end_inset
2024-06-23 09:01:39 +00:00
,
2024-08-11 06:23:08 +00:00
\begin_inset Flex Code
status open
\begin_layout Plain Layout
2002-06-10 04:28:24 +00:00
SEL
2024-08-11 06:23:08 +00:00
\end_layout
\end_inset
2002-06-10 04:28:24 +00:00
and
2024-08-11 06:23:08 +00:00
\begin_inset Flex Code
status open
\begin_layout Plain Layout
2002-06-10 04:28:24 +00:00
IMP
2024-08-11 06:23:08 +00:00
\end_layout
\end_inset
2002-06-10 04:28:24 +00:00
are part of
2024-06-23 09:01:39 +00:00
\family typewriter
\series bold
2002-06-10 04:28:24 +00:00
qfcc
2024-06-23 09:01:39 +00:00
\family default
\series default
2002-06-10 04:28:24 +00:00
's Objective-QC extensions.
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 04:28:24 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Subsection
2002-06-11 14:22:42 +00:00
Enumerators
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 04:28:24 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
2002-06-10 04:28:24 +00:00
as per C
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 04:28:24 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Subsection
2002-06-10 04:28:24 +00:00
Structures
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 04:28:24 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout LyX-Code
2002-06-10 04:28:24 +00:00
struct foo {
2024-06-23 09:01:39 +00:00
\begin_inset Newline newline
\end_inset
2002-06-11 14:22:42 +00:00
integer bar;
2024-06-23 09:01:39 +00:00
\begin_inset Newline newline
\end_inset
2002-06-11 14:22:42 +00:00
float baz;
2024-06-23 09:01:39 +00:00
\begin_inset Newline newline
\end_inset
2002-06-11 14:22:42 +00:00
void () func;
2024-06-23 09:01:39 +00:00
\begin_inset Newline newline
\end_inset
2002-06-10 04:28:24 +00:00
};
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 04:28:24 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
Structures with no elements can be declared for making opaque types (particularly useful for engine interface functions).
\end_layout
2002-06-10 04:28:24 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Subsection
2002-06-10 04:28:24 +00:00
Arrays
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 04:28:24 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout LyX-Code
2024-08-11 06:23:08 +00:00
int [13] array;
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 04:28:24 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Subsection
2002-06-10 04:28:24 +00:00
Pointers
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 04:28:24 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
Pointers are declared the same way as arrays,
but with no number in the
\family typewriter
2002-06-10 04:28:24 +00:00
[]
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 04:28:24 +00:00
s.
2024-06-23 09:01:39 +00:00
In fact,
arrays are just pointers with limited (compile-time) bounds checking (constant indices).
\end_layout
2002-06-10 04:28:24 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Subsection
2002-06-10 04:28:24 +00:00
Complex types
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 04:28:24 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
2002-06-10 04:28:24 +00:00
Complex types can be created by nesting type declarations within
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 04:28:24 +00:00
()
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 04:28:24 +00:00
s.
2002-06-11 14:22:42 +00:00
e.g.:
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 04:28:24 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout LyX-Code
2002-06-10 04:28:24 +00:00
(.float) (string name) find_field;
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 04:28:24 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
2002-06-10 04:28:24 +00:00
declares a function (
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 04:28:24 +00:00
find_field
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 04:28:24 +00:00
) taking a string parameter and returning a float field `offset'.
Without the
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 04:28:24 +00:00
()
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 04:28:24 +00:00
s around the
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 04:28:24 +00:00
.float
2024-06-23 09:01:39 +00:00
\family default
,
the declaration would be a function field.
\end_layout
2002-06-10 04:28:24 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Subsection
2024-08-11 06:23:08 +00:00
\begin_inset Flex Code
status open
2002-06-10 04:28:24 +00:00
2024-08-11 06:23:08 +00:00
\begin_layout Plain Layout
2002-06-10 04:28:24 +00:00
typedef
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 04:28:24 +00:00
2024-08-11 06:23:08 +00:00
\end_inset
\end_layout
2024-06-23 09:01:39 +00:00
\begin_layout Standard
2002-06-10 04:28:24 +00:00
By using
2024-08-11 06:23:08 +00:00
\begin_inset Flex Code
status open
\begin_layout Plain Layout
2002-06-10 04:28:24 +00:00
typedef
2024-08-11 06:23:08 +00:00
\end_layout
\end_inset
2002-06-10 04:28:24 +00:00
complex types can be given symbolic names.
2002-06-11 14:22:42 +00:00
e.g.:
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 04:28:24 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout LyX-Code
2002-06-10 04:28:24 +00:00
struct foo_s {};
2024-06-23 09:01:39 +00:00
\begin_inset Newline newline
\end_inset
2002-06-10 04:28:24 +00:00
typedef foo_s [] foo_t;
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 04:28:24 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
2002-06-10 04:28:24 +00:00
creates type
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 04:28:24 +00:00
foo_t
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 04:28:24 +00:00
which is a pointer to the structure
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 04:28:24 +00:00
foo_s
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 04:28:24 +00:00
(which happens to be opaque).
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 04:28:24 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Subsection
2002-06-11 14:22:42 +00:00
Variable-argument functions
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 04:28:24 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
Typed parameters preceding the ellipsis are allowed,
e.g.:
\family typewriter
void (string fmt,
\SpecialChar ldots
2004-04-28 00:43:03 +00:00
) printf;
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 04:28:24 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
More importantly,
it is now possible to write vararg functions in QC.
2002-06-10 04:28:24 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 04:28:24 +00:00
@argc
2024-06-23 09:01:39 +00:00
\family default
2002-06-11 14:22:42 +00:00
gives the number of parameters passed through the ellipsis and
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 04:28:24 +00:00
@argv
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 04:28:24 +00:00
is an array of vectors representing the parameters passed through
2024-06-23 09:01:39 +00:00
\family typewriter
\SpecialChar ldots
2004-04-28 00:43:03 +00:00
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 04:28:24 +00:00
.
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 04:28:24 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
2002-06-10 04:28:24 +00:00
2024-06-23 09:01:39 +00:00
\series bold
\emph on
Warning:
attempting to pass
\series default
\emph default
\family typewriter
\series bold
\emph on
2002-06-10 04:28:24 +00:00
@argv
2024-06-23 09:01:39 +00:00
\family default
\series default
\emph default
\series bold
\emph on
to a non-engine function will not work.
2002-06-11 14:22:42 +00:00
This is because of changes in how local variables are handled by the compiler.
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 04:28:24 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Subsection
2002-06-10 04:28:24 +00:00
Improved type checking
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 04:28:24 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
Function parameters and return types are are fully checked,
including the number of parameters passed to a function.
Functions with different return types and/or different parameter types or counts are distinct types and mixing them up will cause a type mismatch error.
2002-06-10 05:09:29 +00:00
Similar for pointers to various types.
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 05:09:29 +00:00
2024-08-11 06:23:08 +00:00
\begin_layout Section
Type Expressions
\end_layout
\begin_layout Standard
Type expressions allow for more reusable code as they can specify types based on other types and and their attributes.
\end_layout
\begin_layout LyX-Code
int foo[3];
\end_layout
\begin_layout LyX-Code
@vector(float,sizeof(foo)) bar = '3.14 2.72 1.62';
\end_layout
\begin_layout Standard
In the following,
\family typewriter
type
\family default
must be a type (keyword,
\begin_inset Flex Code
status open
\begin_layout Plain Layout
\family typewriter
typedef
\end_layout
\end_inset
,
or another type expression) and
\begin_inset Flex Code
status open
\begin_layout Plain Layout
\family typewriter
\begin_inset Flex Noun
status open
\begin_layout Plain Layout
\family typewriter
count
\end_layout
\end_inset
\end_layout
\end_inset
,
\begin_inset Flex Code
status open
\begin_layout Plain Layout
\family typewriter
\begin_inset Flex Noun
status open
\begin_layout Plain Layout
\family typewriter
width
\end_layout
\end_inset
\end_layout
\end_inset
,
\begin_inset Flex Code
status open
\begin_layout Plain Layout
\family typewriter
\begin_inset Flex Noun
status open
\begin_layout Plain Layout
\family typewriter
cols
\end_layout
\end_inset
\end_layout
\end_inset
,
\family typewriter
\begin_inset Flex Code
status open
\begin_layout Plain Layout
\family typewriter
\begin_inset Flex Noun
status open
\begin_layout Plain Layout
\family typewriter
rows
\end_layout
\end_inset
\end_layout
\end_inset
\family default
must be constant integral expressions.
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\family typewriter
\begin_inset Flex Code
status open
\begin_layout Plain Layout
\family typewriter
@function(
\family default
\begin_inset Flex Noun
status open
\begin_layout Plain Layout
type
\end_layout
\end_inset
\family typewriter
)
\end_layout
\end_inset
\family default
A function returning
\begin_inset Flex Code
status open
\begin_layout Plain Layout
\begin_inset Flex Noun
status open
\begin_layout Plain Layout
type
\end_layout
\end_inset
\end_layout
\end_inset
but taking no parameters
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status open
\begin_layout Plain Layout
@field(
\begin_inset Flex Noun
status open
\begin_layout Plain Layout
type
\end_layout
\end_inset
)
\end_layout
\end_inset
A field of
\begin_inset Flex Code
status open
\begin_layout Plain Layout
\begin_inset Flex Noun
status open
\begin_layout Plain Layout
type
\end_layout
\end_inset
\end_layout
\end_inset
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status open
\begin_layout Plain Layout
@pointer(
\begin_inset Flex Noun
status open
\begin_layout Plain Layout
type
\end_layout
\end_inset
)
\end_layout
\end_inset
A pointer to
\begin_inset Flex Code
status open
\begin_layout Plain Layout
\begin_inset Flex Noun
status open
\begin_layout Plain Layout
type
\end_layout
\end_inset
\end_layout
\end_inset
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status open
\begin_layout Plain Layout
@array(
\begin_inset Flex Noun
status open
\begin_layout Plain Layout
type
\end_layout
\end_inset
,[
\begin_inset Flex Noun
status open
\begin_layout Plain Layout
count
\end_layout
\end_inset
])
\end_layout
\end_inset
An array of
\begin_inset Flex Code
status open
\begin_layout Plain Layout
\begin_inset Flex Noun
status open
\begin_layout Plain Layout
type
\end_layout
\end_inset
\end_layout
\end_inset
elements,
optionally sized to
\begin_inset Flex Code
status open
\begin_layout Plain Layout
\begin_inset Flex Noun
status open
\begin_layout Plain Layout
count
\end_layout
\end_inset
\end_layout
\end_inset
.
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status open
\begin_layout Plain Layout
@base(
\begin_inset Flex Noun
status open
\begin_layout Plain Layout
type
\end_layout
\end_inset
)
\end_layout
\end_inset
The base scalar type for
\begin_inset Flex Code
status open
\begin_layout Plain Layout
\begin_inset Flex Noun
status open
\begin_layout Plain Layout
type
\end_layout
\end_inset
\end_layout
\end_inset
.
Always
\begin_inset Flex Code
status open
\begin_layout Plain Layout
float
\end_layout
\end_inset
for
\begin_inset Flex Code
status open
\begin_layout Plain Layout
vector
\end_layout
\end_inset
and
\begin_inset Flex Code
status open
\begin_layout Plain Layout
quaternion
\end_layout
\end_inset
.
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status open
\begin_layout Plain Layout
@vector(
\begin_inset Flex Noun
status open
\begin_layout Plain Layout
type
\end_layout
\end_inset
,
\begin_inset Flex Noun
status open
\begin_layout Plain Layout
width
\end_layout
\end_inset
)
\end_layout
\end_inset
A vector type with the same base type as
\begin_inset Flex Code
status open
\begin_layout Plain Layout
\begin_inset Flex Noun
status open
\begin_layout Plain Layout
type
\end_layout
\end_inset
\end_layout
\end_inset
,
but with the specified width.
Never returns
\begin_inset Flex Code
status open
\begin_layout Plain Layout
vector
\end_layout
\end_inset
or
\begin_inset Flex Code
status open
\begin_layout Plain Layout
quaternion
\end_layout
\end_inset
(returns
\begin_inset Flex Code
status open
\begin_layout Plain Layout
vec3
\end_layout
\end_inset
or
\begin_inset Flex Code
status open
\begin_layout Plain Layout
vec4
\end_layout
\end_inset
instead)
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status open
\begin_layout Plain Layout
@matrix(
\begin_inset Flex Noun
status open
\begin_layout Plain Layout
type
\end_layout
\end_inset
,
\begin_inset Flex Noun
status open
\begin_layout Plain Layout
cols
\end_layout
\end_inset
,
\begin_inset Flex Noun
status open
\begin_layout Plain Layout
rows
\end_layout
\end_inset
)
\end_layout
\end_inset
A matrix type with the same base type as
\begin_inset Flex Code
status open
\begin_layout Plain Layout
\begin_inset Flex Noun
status open
\begin_layout Plain Layout
type
\end_layout
\end_inset
\end_layout
\end_inset
but with the specified columns and rows
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status open
\begin_layout Plain Layout
@int(
\begin_inset Flex Noun
status open
\begin_layout Plain Layout
type
\end_layout
\end_inset
)
\end_layout
\end_inset
An integral scalar with the same size as the base type of
\begin_inset Flex Code
status open
\begin_layout Plain Layout
\begin_inset Flex Noun
status open
\begin_layout Plain Layout
type
\end_layout
\end_inset
\end_layout
\end_inset
.
\begin_inset Flex Code
status open
\begin_layout Plain Layout
int
\end_layout
\end_inset
or
\begin_inset Flex Code
status open
\begin_layout Plain Layout
long
\end_layout
\end_inset
.
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status open
\begin_layout Plain Layout
@uint(
\begin_inset Flex Noun
status open
\begin_layout Plain Layout
type
\end_layout
\end_inset
)
\end_layout
\end_inset
An unsigned integral scalar with the same size as the base type of
\begin_inset Flex Code
status open
\begin_layout Plain Layout
\begin_inset Flex Noun
status open
\begin_layout Plain Layout
type
\end_layout
\end_inset
\end_layout
\end_inset
.
\begin_inset Flex Code
status open
\begin_layout Plain Layout
unsigned int
\end_layout
\end_inset
or
\begin_inset Flex Code
status open
\begin_layout Plain Layout
unsigned long
\end_layout
\end_inset
.
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status open
\begin_layout Plain Layout
@bool(
\begin_inset Flex Noun
status open
\begin_layout Plain Layout
type
\end_layout
\end_inset
)
\end_layout
\end_inset
A boolean scalar with the same size as the base type of
\begin_inset Flex Code
status open
\begin_layout Plain Layout
\begin_inset Flex Noun
status open
\begin_layout Plain Layout
type
\end_layout
\end_inset
\end_layout
\end_inset
.
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status open
\begin_layout Plain Layout
@float(
\begin_inset Flex Noun
status open
\begin_layout Plain Layout
type
\end_layout
\end_inset
)
\end_layout
\end_inset
A floating point scalar with the same size as the base type of
\begin_inset Flex Code
status open
\begin_layout Plain Layout
\begin_inset Flex Noun
status open
\begin_layout Plain Layout
type
\end_layout
\end_inset
\end_layout
\end_inset
.
\begin_inset Flex Code
status open
\begin_layout Plain Layout
float
\end_layout
\end_inset
or
\begin_inset Flex Code
status open
\begin_layout Plain Layout
double
\end_layout
\end_inset
.
\end_layout
\begin_layout Standard
The following complement the
\begin_inset Flex Code
status open
\begin_layout Plain Layout
sizeof
\end_layout
\end_inset
keyword:
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status open
\begin_layout Plain Layout
@width(
\begin_inset Flex Noun
status open
\begin_layout Plain Layout
type
\end_layout
\end_inset
)
\end_layout
\end_inset
The number of elements in
\begin_inset Flex Code
status open
\begin_layout Plain Layout
\begin_inset Flex Noun
status open
\begin_layout Plain Layout
type
\end_layout
\end_inset
\end_layout
\end_inset
.
Always 1 for scalars and matrices,
3 for
\begin_inset Flex Code
status open
\begin_layout Plain Layout
vector
\end_layout
\end_inset
and 4 for
\begin_inset Flex Code
status open
\begin_layout Plain Layout
quaternion
\end_layout
\end_inset
.
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status open
\begin_layout Plain Layout
@rows(
\begin_inset Flex Noun
status open
\begin_layout Plain Layout
type
\end_layout
\end_inset
)
\end_layout
\end_inset
The number of rows in
\begin_inset Flex Code
status open
\begin_layout Plain Layout
\begin_inset Flex Noun
status open
\begin_layout Plain Layout
type
\end_layout
\end_inset
\end_layout
\end_inset
.
Same as
\begin_inset Flex Code
status open
\begin_layout Plain Layout
@width(
\begin_inset Flex Noun
status open
\begin_layout Plain Layout
type
\end_layout
\end_inset
)
\end_layout
\end_inset
for vectors and scalars.
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status open
\begin_layout Plain Layout
@cols(
\begin_inset Flex Noun
status open
\begin_layout Plain Layout
type
\end_layout
\end_inset
)
\end_layout
\end_inset
The number of columns in
\begin_inset Flex Code
status open
\begin_layout Plain Layout
\begin_inset Flex Noun
status open
\begin_layout Plain Layout
type
\end_layout
\end_inset
\end_layout
\end_inset
.
Always 1 for vectors and scalars:
vectors are column matrices and scalars are essentially 1x1 matrices.
\end_layout
2024-06-23 09:01:39 +00:00
\begin_layout Chapter
2002-06-10 05:09:29 +00:00
Variables
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 05:09:29 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Section
2002-06-10 05:09:29 +00:00
Local variables
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 05:09:29 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Subsubsection
2002-06-10 05:09:29 +00:00
Initialization
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 05:09:29 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
2002-06-10 05:09:29 +00:00
Local variables of basic types can now be initialized when declared.
2002-06-11 14:22:42 +00:00
e,g,
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 05:09:29 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Verse
2002-06-10 05:09:29 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 05:09:29 +00:00
local integer elite = 31337;
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 05:09:29 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Subsubsection
2002-06-10 05:09:29 +00:00
Unused variables
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 05:09:29 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
2002-06-10 05:09:29 +00:00
Local variables that are declared but not used produce a warning.
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 05:09:29 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Subsubsection
2002-06-10 05:09:29 +00:00
Uninitialized variables
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 05:09:29 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
Checks are done to ensure that local variables have been initialized before being used.
However,
these checks are not perfect and false positives are very likely in complex code.
Occurrences of false negatives are not known,
but the possibility of their existence remains and any examples of false negatives should be reported as bugs.
\end_layout
2002-06-10 05:09:29 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Section
2002-06-10 05:09:29 +00:00
Complex global variables
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 05:09:29 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
2002-06-10 05:09:29 +00:00
Global array variables can be initialized using
2024-06-23 09:01:39 +00:00
\family typewriter
= {
\family default
\family typewriter
\emph on
2002-06-11 14:22:42 +00:00
element-list
2024-06-23 09:01:39 +00:00
\family default
\emph default
\family typewriter
};
\family default
2002-06-10 05:09:29 +00:00
.
Element lists may be nested using
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 05:09:29 +00:00
{}
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 05:09:29 +00:00
.
2024-06-23 09:01:39 +00:00
Structures cannot currently be initialized,
but this is a FIXME :)
\end_layout
2002-06-10 05:09:29 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Section
2002-06-10 05:09:29 +00:00
Magic variables
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 05:09:29 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Labeling
\labelwidthstring 00.00.0000
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-11 14:22:42 +00:00
@self
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
Automagically-declared entity variable the engine will use for
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 05:09:29 +00:00
touch
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 05:09:29 +00:00
and
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 05:09:29 +00:00
think
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 05:09:29 +00:00
functions.
This allows
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 05:09:29 +00:00
self
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 05:09:29 +00:00
to be used as the object hidden parameter in methods.
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 05:09:29 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Labeling
\labelwidthstring 00.00.0000
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-11 14:22:42 +00:00
@this
2024-06-23 09:01:39 +00:00
\family default
2003-02-18 20:08:05 +00:00
Automagically-declared
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 05:09:29 +00:00
id
2024-06-23 09:01:39 +00:00
\family default
field that the engine expects to point to the object associated with the entity.
The engine will use this field,
if it exists,
to set the
\family typewriter
2002-06-10 05:09:29 +00:00
self
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 05:09:29 +00:00
parameter to
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 05:09:29 +00:00
touch
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 05:09:29 +00:00
and
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 05:09:29 +00:00
think
2024-06-23 09:01:39 +00:00
\family default
methods (the engine assumes it's calling a method rather than a function if the @this field is used.
\end_layout
2002-06-10 05:09:29 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Labeling
\labelwidthstring 00.00.0000
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-11 14:22:42 +00:00
@argc
2024-06-23 09:01:39 +00:00
\family default
2002-06-11 14:22:42 +00:00
Number of parameters passed through
2024-06-23 09:01:39 +00:00
\family typewriter
\SpecialChar ldots
2002-06-10 05:09:29 +00:00
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 05:09:29 +00:00
in vararg functions.
Not valid elsewhere.
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 05:09:29 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Labeling
\labelwidthstring 00.00.0000
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-11 14:22:42 +00:00
@argv
2024-06-23 09:01:39 +00:00
\family default
2002-06-11 14:22:42 +00:00
Array of vectors representing the parameters passed through
2024-06-23 09:01:39 +00:00
\family typewriter
\SpecialChar ldots
2002-06-10 05:09:29 +00:00
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 05:09:29 +00:00
in vararg functions.
Not valid elsewhere.
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Chapter
2002-06-10 06:18:59 +00:00
Code constructs
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Section
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 06:18:59 +00:00
break
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
2002-06-10 06:18:59 +00:00
The
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 06:18:59 +00:00
break
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 06:18:59 +00:00
statement can be used to leave a loop (
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 06:18:59 +00:00
while
2024-06-23 09:01:39 +00:00
\family default
,
\family typewriter
2002-06-10 06:18:59 +00:00
do
2024-06-23 09:01:39 +00:00
\family default
\SpecialChar ldots
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 06:18:59 +00:00
while
2024-06-23 09:01:39 +00:00
\family default
,
or
\family typewriter
2002-06-10 06:18:59 +00:00
for
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 06:18:59 +00:00
) prematurely.
The
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 06:18:59 +00:00
break
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 06:18:59 +00:00
statement is also used to leave a
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 06:18:59 +00:00
switch
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 06:18:59 +00:00
statement.
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Section
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 06:18:59 +00:00
continue
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
2002-06-10 06:18:59 +00:00
The
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 06:18:59 +00:00
continue
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 06:18:59 +00:00
statement is used to jump to the beginning of a loop.
In
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 06:18:59 +00:00
for
2024-06-23 09:01:39 +00:00
\family default
loops,
the test and post expressions are evaluated before continuing with the loop.
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Section
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 06:18:59 +00:00
for
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
2002-06-10 06:18:59 +00:00
The
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 06:18:59 +00:00
for
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 06:18:59 +00:00
loop is:
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout LyX-Code
2002-06-10 06:18:59 +00:00
for (
2024-06-23 09:01:39 +00:00
\emph on
2002-06-11 14:22:42 +00:00
initialization-expression
2024-06-23 09:01:39 +00:00
\emph default
;
\emph on
2002-06-11 14:22:42 +00:00
test-expression
2024-06-23 09:01:39 +00:00
\emph default
;
\emph on
2002-06-11 14:22:42 +00:00
post-expression
2024-06-23 09:01:39 +00:00
\emph default
2002-06-10 06:18:59 +00:00
)
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout LyX-Code
\emph on
statement
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
2002-06-10 06:18:59 +00:00
and is equivalent to
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout LyX-Code
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\emph on
2002-06-11 14:22:42 +00:00
initialization expression
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout LyX-Code
2002-06-10 06:18:59 +00:00
while (
2024-06-23 09:01:39 +00:00
\emph on
2002-06-11 14:22:42 +00:00
test expression
2024-06-23 09:01:39 +00:00
\emph default
2002-06-10 06:18:59 +00:00
) {
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout LyX-Code
\emph on
statement
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout LyX-Code
\emph on
post expression
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout LyX-Code
2002-06-10 06:18:59 +00:00
}
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Section
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 06:18:59 +00:00
switch
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
2002-06-10 06:18:59 +00:00
The
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 06:18:59 +00:00
switch
2024-06-23 09:01:39 +00:00
\family default
statement is used to select between multiple code blocks based on the value of an expression.
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout LyX-Code
2002-06-10 06:18:59 +00:00
switch (
2024-06-23 09:01:39 +00:00
\emph on
2002-06-11 14:22:42 +00:00
test expression
2024-06-23 09:01:39 +00:00
\emph default
2002-06-10 06:18:59 +00:00
) {
2024-06-23 09:01:39 +00:00
\begin_inset Newline newline
\end_inset
case
\emph on
value
\emph default
2002-06-10 06:18:59 +00:00
:
2024-06-23 09:01:39 +00:00
\begin_inset Newline newline
\end_inset
\emph on
optional statements
\begin_inset Newline newline
\end_inset
2002-06-10 16:10:44 +00:00
2002-06-11 14:22:42 +00:00
2024-06-23 09:01:39 +00:00
\emph default
case
\emph on
value
\emph default
2002-06-10 06:18:59 +00:00
:
2024-06-23 09:01:39 +00:00
\begin_inset Newline newline
\end_inset
\emph on
optional statements
\emph default
2002-06-10 16:10:44 +00:00
2024-06-23 09:01:39 +00:00
\begin_inset Newline newline
\end_inset
2002-06-10 16:10:44 +00:00
2002-06-11 14:22:42 +00:00
default:
2024-06-23 09:01:39 +00:00
\begin_inset Newline newline
\end_inset
2002-06-10 16:10:44 +00:00
2024-06-23 09:01:39 +00:00
\emph on
optional statements
\emph default
\begin_inset Newline newline
\end_inset
2002-06-10 16:10:44 +00:00
2002-06-10 06:18:59 +00:00
}
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
2002-06-10 06:18:59 +00:00
Code execution starts at the selected
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 06:18:59 +00:00
case
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 06:18:59 +00:00
and continues on to the end of the switch block.
Following
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 06:18:59 +00:00
case
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 06:18:59 +00:00
s do
2024-06-23 09:01:39 +00:00
\emph on
2002-06-10 06:18:59 +00:00
not
2024-06-23 09:01:39 +00:00
\emph default
2002-06-10 06:18:59 +00:00
affect code execution.
2024-06-23 09:01:39 +00:00
If this behavior is not desired,
as is usual,
then a
\family typewriter
2002-06-10 06:18:59 +00:00
break
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 06:18:59 +00:00
statement is required to cause the code to jump to the end of the
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 06:18:59 +00:00
switch
2024-06-23 09:01:39 +00:00
\family default
,
skipping any intervening code.
That is,
just like C.
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Subsubsection
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
\emph on
2002-06-10 06:18:59 +00:00
test expression
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
The test expression may result in a float,
string or integer value.
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Subsubsection
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
case
\family default
\family typewriter
\emph on
2002-06-10 06:18:59 +00:00
value
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Verse
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
case
\family default
\family typewriter
\emph on
2002-06-10 06:18:59 +00:00
value
2024-06-23 09:01:39 +00:00
\emph default
2002-06-10 06:18:59 +00:00
:
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
The case value may be of any constant type consistent with the test expression of the
\family typewriter
2002-06-10 06:18:59 +00:00
switch
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 06:18:59 +00:00
.
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Subsubsection
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 06:18:59 +00:00
default
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
If specified,
this is where execution will go when no
\family typewriter
2002-06-10 06:18:59 +00:00
case
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 06:18:59 +00:00
has been selected by the test expression.
2024-06-23 09:01:39 +00:00
If not specified,
and no
\family typewriter
2002-06-10 06:18:59 +00:00
case
2024-06-23 09:01:39 +00:00
\family default
has been selected by the test expression,
the
\family typewriter
2002-06-10 06:18:59 +00:00
switch
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 06:18:59 +00:00
does not execute any code within the block.
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Section
2002-06-10 06:18:59 +00:00
Expressions
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Subsection
2002-06-10 06:18:59 +00:00
Binary
2024-06-23 09:01:39 +00:00
\end_layout
\begin_layout Labeling
2002-06-10 06:18:59 +00:00
\labelwidthstring 00.00.0000
2024-06-23 09:01:39 +00:00
\family typewriter
<<
\begin_inset space ~
\end_inset
2002-06-10 06:18:59 +00:00
>>
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 06:18:59 +00:00
bit shift left and right
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Labeling
\labelwidthstring 00.00.0000
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 06:18:59 +00:00
^
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 06:18:59 +00:00
bitwise exclusive or
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Labeling
\labelwidthstring 00.00.0000
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 06:18:59 +00:00
%
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 06:18:59 +00:00
modulus
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Subsubsection
2002-06-10 06:18:59 +00:00
Assignment
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Labeling
\labelwidthstring 00.00.0000
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
\emph on
2002-06-10 06:18:59 +00:00
op
2024-06-23 09:01:39 +00:00
\emph default
=
\family default
equivalent to
\family typewriter
a = a
\family default
\family typewriter
\emph on
op
\family default
\emph default
\family typewriter
2002-06-10 06:18:59 +00:00
b
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 06:18:59 +00:00
.
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Subsection
2002-06-10 06:18:59 +00:00
Unary
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Labeling
\labelwidthstring 00.00.0000
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 06:18:59 +00:00
~
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 06:18:59 +00:00
bitwise not
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Labeling
\labelwidthstring 00.00.0000
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 06:18:59 +00:00
&
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 06:18:59 +00:00
address
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Labeling
\labelwidthstring 00.00.0000
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 06:18:59 +00:00
++
2024-06-23 09:01:39 +00:00
\emph on
2002-06-10 06:18:59 +00:00
e
2024-06-23 09:01:39 +00:00
\emph default
\begin_inset space ~
\end_inset
2002-06-10 06:18:59 +00:00
--
2024-06-23 09:01:39 +00:00
\emph on
2002-06-10 06:18:59 +00:00
e
2024-06-23 09:01:39 +00:00
\family default
\emph default
2002-06-11 14:22:42 +00:00
pre-increment and decrement
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Labeling
\labelwidthstring 00.00.0000
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
\emph on
2002-06-10 06:18:59 +00:00
e
2024-06-23 09:01:39 +00:00
\emph default
++
\begin_inset space ~
\end_inset
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\emph on
2002-06-10 06:18:59 +00:00
e
2024-06-23 09:01:39 +00:00
\emph default
2002-06-10 06:18:59 +00:00
--
2024-06-23 09:01:39 +00:00
\family default
2002-06-11 14:22:42 +00:00
post-increment and decrement
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Subsection
2002-06-10 06:18:59 +00:00
Other
2024-06-23 09:01:39 +00:00
\end_layout
\begin_layout Labeling
2002-06-10 06:18:59 +00:00
\labelwidthstring 00.00.0000
2024-06-23 09:01:39 +00:00
\family typewriter
\emph on
type
\begin_inset space ~
\end_inset
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\emph default
2002-06-10 06:18:59 +00:00
(
2024-06-23 09:01:39 +00:00
\emph on
2002-06-10 06:18:59 +00:00
expr
2024-06-23 09:01:39 +00:00
\emph default
2002-06-10 06:18:59 +00:00
)
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 06:18:59 +00:00
cast expression.
2024-06-23 09:01:39 +00:00
Works only for converting between integer and float types and between pointer types.
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Labeling
\labelwidthstring 00.00.0000
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
\emph on
2002-06-10 06:18:59 +00:00
expr
2024-06-23 09:01:39 +00:00
\emph default
2002-06-10 06:18:59 +00:00
[
2024-06-23 09:01:39 +00:00
\emph on
2002-06-10 06:18:59 +00:00
expr
2024-06-23 09:01:39 +00:00
\emph default
]
\family default
array indexing.
\end_layout
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Labeling
\labelwidthstring 00.00.0000
2002-06-10 06:18:59 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
\emph on
2002-06-10 06:18:59 +00:00
expr
2024-06-23 09:01:39 +00:00
\emph default
2002-06-10 06:18:59 +00:00
?
2024-06-23 09:01:39 +00:00
\emph on
2002-06-10 06:18:59 +00:00
expr
2024-06-23 09:01:39 +00:00
\emph default
2002-06-10 06:18:59 +00:00
:
2024-06-23 09:01:39 +00:00
\emph on
expr
\family default
\emph default
C's trinary expression
\end_layout
2002-06-10 16:10:44 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Labeling
\labelwidthstring 00.00.0000
2002-06-10 16:10:44 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 16:10:44 +00:00
[
2024-06-23 09:01:39 +00:00
\emph on
2002-06-10 16:10:44 +00:00
expr
2024-06-23 09:01:39 +00:00
\emph default
2002-06-10 16:10:44 +00:00
2024-06-23 09:01:39 +00:00
\begin_inset space ~
\end_inset
\emph on
2002-06-10 16:10:44 +00:00
exprs
2024-06-23 09:01:39 +00:00
\emph default
2002-06-10 16:10:44 +00:00
]
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 16:10:44 +00:00
Objective-QC message
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 16:10:44 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Labeling
\labelwidthstring 00.00.0000
2002-06-10 16:10:44 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 16:10:44 +00:00
@selector(
2024-06-23 09:01:39 +00:00
\emph on
2002-06-10 16:10:44 +00:00
exprs
2024-06-23 09:01:39 +00:00
\emph default
2002-06-10 16:10:44 +00:00
)
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 16:10:44 +00:00
Objective-QC selector expression
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 16:10:44 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Labeling
\labelwidthstring 00.00.0000
2002-06-10 16:10:44 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 16:10:44 +00:00
@protocol(
2024-06-23 09:01:39 +00:00
\emph on
2002-06-10 16:10:44 +00:00
name
2024-06-23 09:01:39 +00:00
\emph default
2002-06-10 16:10:44 +00:00
)
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 16:10:44 +00:00
Objective-QC protocol expression
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 16:10:44 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Labeling
\labelwidthstring 00.00.0000
2002-06-10 16:10:44 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 16:10:44 +00:00
@encode(
2024-06-23 09:01:39 +00:00
\emph on
2002-06-10 16:10:44 +00:00
type
2024-06-23 09:01:39 +00:00
\emph default
2002-06-10 16:10:44 +00:00
)
2024-06-23 09:01:39 +00:00
\family default
2002-06-10 16:10:44 +00:00
Objective-QC type encoding expression
2024-06-23 09:01:39 +00:00
\end_layout
2002-06-10 16:10:44 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Labeling
\labelwidthstring 00.00.0000
2002-06-10 16:10:44 +00:00
2024-06-23 09:01:39 +00:00
\family typewriter
2002-06-10 16:10:44 +00:00
@
2024-06-23 09:01:39 +00:00
\emph on
2002-06-10 16:10:44 +00:00
string
2024-06-23 09:01:39 +00:00
\family default
\emph default
2002-06-10 16:10:44 +00:00
Objective-QC string object.
Currently identical to a normal QC string.
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\begin_layout Standard
\begin_inset CommandInset index_print
LatexCommand printindex
type "idx"
name "Index"
literal "true"
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_inset
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_layout
2003-02-18 20:08:05 +00:00
2024-06-23 09:01:39 +00:00
\end_body
\end_document