aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-08-14 17:07:25 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-08-14 17:07:25 -0300
commit82a3be0671fd222dd53cab00183e473acb5e322f (patch)
tree8803274fe0f6b725d0b978f1b4e0ab2e44c7791f
parent94b5ad31f4e6bd0a93b8b156e7274e8aae7e2535 (diff)
downloadlua-82a3be0671fd222dd53cab00183e473acb5e322f.tar.gz
lua-82a3be0671fd222dd53cab00183e473acb5e322f.tar.bz2
lua-82a3be0671fd222dd53cab00183e473acb5e322f.zip
some corrections + angles in radians
-rw-r--r--manual.tex43
1 files changed, 29 insertions, 14 deletions
diff --git a/manual.tex b/manual.tex
index eba2249a..bd1f9464 100644
--- a/manual.tex
+++ b/manual.tex
@@ -1,7 +1,7 @@
1% $Id: manual.tex,v 1.60 2002/08/13 19:44:47 roberto Exp roberto $ 1% $Id: manual.tex,v 1.61 2002/08/13 20:00:51 roberto Exp roberto $
2%{[( 2%{[(
3 3
4\documentclass[11pt,twoside,draft]{article} 4\documentclass[11pt,twoside]{article}
5\usepackage{fullpage} 5\usepackage{fullpage}
6\usepackage{bnf} 6\usepackage{bnf}
7\usepackage{graphicx} 7\usepackage{graphicx}
@@ -134,7 +134,7 @@ Waldemar Celes
134\tecgraf\ --- Computer Science Department --- PUC-Rio 134\tecgraf\ --- Computer Science Department --- PUC-Rio
135} 135}
136 136
137%\date{{\small \tt\$Date: 2002/08/13 19:44:47 $ $}} 137%\date{{\small \tt\$Date: 2002/08/13 20:00:51 $ $}}
138 138
139\maketitle 139\maketitle
140 140
@@ -3138,7 +3138,7 @@ from the end of the string.
3138Thus, the last character is at position \Math{-1}, and so on. 3138Thus, the last character is at position \Math{-1}, and so on.
3139 3139
3140The string library provides all its functions inside the table 3140The string library provides all its functions inside the table
3141\DefLIB{string}. 3141\IndexLIB{string}.
3142 3142
3143\subsubsection*{\ff \T{string.byte (s [, i])}}\DefLIB{string.byte} 3143\subsubsection*{\ff \T{string.byte (s [, i])}}\DefLIB{string.byte}
3144Returns the internal numerical code of the \M{i}-th character of \verb|s|. 3144Returns the internal numerical code of the \M{i}-th character of \verb|s|.
@@ -3422,7 +3422,7 @@ A pattern cannot contain embedded zeros. Use \verb|%z| instead.
3422 3422
3423\subsection{Table Manipulation} 3423\subsection{Table Manipulation}
3424This library provides generic functions for table manipulation, 3424This library provides generic functions for table manipulation,
3425It provides all its functions inside the table \DefLIB{table}. 3425It provides all its functions inside the table \IndexLIB{table}.
3426 3426
3427Most functions in the table library library assume that the table 3427Most functions in the table library library assume that the table
3428represents an array or a list. 3428represents an array or a list.
@@ -3559,10 +3559,8 @@ The library provides the following functions:
3559\end{verbatim} 3559\end{verbatim}
3560plus a variable \IndexLIB{math.pi}. 3560plus a variable \IndexLIB{math.pi}.
3561Most of them 3561Most of them
3562are only interfaces to the homonymous functions in the C~library, 3562are only interfaces to the homonymous functions in the C~library.
3563except that, for the trigonometric functions, 3563The functions \verb|math.deg| and \verb|math.rad| convert
3564all angles are expressed in \emph{degrees}, not radians.
3565The functions \verb|math.deg| and \verb|math.rad| can be used to convert
3566between radians and degrees. 3564between radians and degrees.
3567 3565
3568The function \verb|math.max| returns the maximum 3566The function \verb|math.max| returns the maximum
@@ -3593,14 +3591,14 @@ and all input/output operations are over those default files.
3593The second style uses explicit file descriptors. 3591The second style uses explicit file descriptors.
3594 3592
3595When using implicit file descriptors, 3593When using implicit file descriptors,
3596all operations are supplied by table \DefLIB{io}. 3594all operations are supplied by table \IndexLIB{io}.
3597When using explicit file descriptors, 3595When using explicit file descriptors,
3598the operation \DefLIB{io.open} returns a file descriptor, 3596the operation \IndexLIB{io.open} returns a file descriptor,
3599and then all operations are supplied as methods by the file descriptor. 3597and then all operations are supplied as methods by the file descriptor.
3600 3598
3601Moreover, the table \verb|io| also provides 3599Moreover, the table \verb|io| also provides
3602three predefined file descriptors: 3600three predefined file descriptors:
3603\DefLIB{io.stdin}, \DefLIB{io.stdout}, and \DefLIB{io.stderr}, 3601\IndexLIB{io.stdin}, \IndexLIB{io.stdout}, and \IndexLIB{io.stderr},
3604with their usual meaning from C. 3602with their usual meaning from C.
3605 3603
3606A file handle is a userdata containing the file stream (\verb|FILE*|), 3604A file handle is a userdata containing the file stream (\verb|FILE*|),
@@ -3613,7 +3611,8 @@ and some value different from \nil{} on success.
3613 3611
3614\subsubsection*{\ff \T{io.close ([handle])}}\DefLIB{io.close} 3612\subsubsection*{\ff \T{io.close ([handle])}}\DefLIB{io.close}
3615 3613
3616Equivalent to \verb|fh:close| over the default output file. 3614Equivalent to \verb|handle:close()|.
3615Without a \verb|handle|, closes the default output file.
3617 3616
3618\subsubsection*{\ff \T{io.flush ()}}\DefLIB{io.flush} 3617\subsubsection*{\ff \T{io.flush ()}}\DefLIB{io.flush}
3619 3618
@@ -3746,7 +3745,7 @@ plus a string describing the error.
3746 3745
3747\subsection{Operating System Facilities} \label{libiosys} 3746\subsection{Operating System Facilities} \label{libiosys}
3748 3747
3749This library is implemented through table \DefLIB{os}. 3748This library is implemented through table \IndexLIB{os}.
3750 3749
3751\subsubsection*{\ff \T{os.clock ()}}\DefLIB{os.clock} 3750\subsubsection*{\ff \T{os.clock ()}}\DefLIB{os.clock}
3752 3751
@@ -4121,6 +4120,11 @@ The precedence of \rwd{or} is smaller than the precedence of \rwd{and}.
4121\rwd{in} is a reserved word. 4120\rwd{in} is a reserved word.
4122 4121
4123\item 4122\item
4123The old construction \verb|for k,v in t|, where \verb|t| is a table,
4124is deprecated (although it is still supported).
4125Use \verb|for k,v in pairs(t)| instead.
4126
4127\item
4124When a literal string of the form \verb|[[...]]| starts with a newline, 4128When a literal string of the form \verb|[[...]]| starts with a newline,
4125this newline is ignored. 4129this newline is ignored.
4126 4130
@@ -4138,6 +4142,17 @@ There is a compatibility script (\verb|compat.lua|) that
4138redefine most of them as global names. 4142redefine most of them as global names.
4139 4143
4140\item 4144\item
4145In the math library, angles are expressed in radians.
4146With the compatibility script (\verb|compat.lua|),
4147functions still work in degrees.
4148
4149\item
4150The \verb|call| function is deprecated.
4151Use \verb|f(unpack(tab))| instead of \verb|call(f, tab)|
4152for unprotected calls,
4153or the new \verb|pcall| function for protected calls.
4154
4155\item
4141\verb|dofile| do not handle errors, but simply propagate them. 4156\verb|dofile| do not handle errors, but simply propagate them.
4142 4157
4143\item 4158\item