Branch: Tag:


1996-03-31 04:14:14 by Fredrik Hübinette (Hubbe) <>

documentation fixed

Rev: doc/index.bmml:1.3
Rev: doc/lpc/cast:1.1
Rev: doc/lpc/functions:1.2
Rev: doc/lpc/modifier:1.1
Rev: doc/lpc/reserved:1.3(DEAD)
Rev: doc/lpc/reserved.bmml:1.1
Rev: doc/manual/example1:1.3
Rev: doc/manual/example2:1.2
Rev: doc/manual/example3:1.2
Rev: doc/simulated/write_file:1.3
Rev: doc/types/mixed:1.1
Rev: doc/types/program:1.4
Rev: doc/types/string:1.4

1185:      </doc>   </docgroup> + <docgroup homogen-name='cast' homogen-type='method'> + <method name='cast'/><doc placeholder='true'> + <text> + <p><tt>cast</tt> - convert one type to another</p> +  + <tt><p>( <i>type</i> ) <i>expression</i><br/> + </p> + </tt> + <p>Casts convert types, in most cases it just tells the compiler what + type the expression has, but it can also be used to actually convert + the value of the expression into something else. + </p> + <p>Casting from float or int to string will convert the given number + into a decimal ascii string representation. + </p> + <p>Casting from string to float or int will do the opposite. IE. + Read a decimal number from the string and return that. + </p> + <p>Casting from string to program will call cast_to_program in the + master object and request a program to return. The standard master + object will consider the string a file name and compile the program + given by that string. It will then put the program in a chache in + case you cast the same string to a program again later. + </p> + <p>In all other cases, casts are just compiler hints.</p> +  + lpc</text> +  + <group><seealso/><text> + <p><ref resolved='predef::compile_file' to='compile_file'>compile_file</ref> and <ref resolved='predef::sscanf' to='sscanf'>sscanf</ref></p> + </text></group> +  + </doc> + </docgroup>   <docgroup homogen-name='catch' homogen-type='method'>   <method name='catch'/><doc placeholder='true'>   <text>
2125:   </text></group></dl>}<br/>   </p>   </tt> + <p>A function is basically a piece of code which takes some data + does some things, and hands some data back. Data sent to a + a function is called an 'argument'. + </p>   <p>This defines a function called 'function_name' returning the type   'type'. The argument_specification is a comma separated list of   arguments. Each argument is specified with a type, whitespace and
2194:   lpc</text></group>      <group><seealso/><text> - <p><ref resolved='predef::lambda' to='lambda'>lambda</ref>, <ref resolved='predef::return' to='return'>return</ref> and <ref to='modifier'>modifier</ref></p> + <p><ref resolved='predef::lambda' to='lambda'>lambda</ref>, <ref resolved='predef::return' to='return'>return</ref> and <ref resolved='predef::modifier' to='modifier'>modifier</ref></p>   </text></group>      </doc>
3003:      </doc>   </docgroup> + <docgroup homogen-name='mixed' homogen-type='method'> + <method name='mixed'/><doc placeholder='true'> + <text> + <p><tt>mixed</tt> - any type</p> +  + <p>This is not really a type. But this keyword can be used to specify + that a variable, argument or return type can be of any type.</p> + </text> +  + <group><example/><text> + <tt><p>mixed i=1;<br/> + mixed j="foo";<br/> + mixed foo() { return "bar"; }<br/> + mixed bar() { return ({}); }<br/> + </p> + </tt> + types</text></group> +  + </doc> + </docgroup>   <docgroup homogen-name='mkdir' homogen-type='method'>   <method name='mkdir'/><doc placeholder='true'>   <text>
3069:      </doc>   </docgroup> + <docgroup homogen-name='modifier' homogen-type='method'> + <method name='modifier'/><doc placeholder='true'> + <text> + <p><tt>modifier</tt> - modify function / variable definitions</p> +  + <p>Modifiers makes it possible to give functions and gobal variables + certain characteristics. A list of modifiers follows: + </p> + <p><matrix> + <r><c> static </c><c> make this identifier unavailable by indexing </c></r> + <r><c> inline </c><c> allow inlining this function </c></r> + <r><c> private </c><c> hide this identifier to inheriting programs </c></r> + <r><c> nomask </c><c> don't allow this identifier to be re-defined </c></r> + </matrix> + </p> +  + lpc</text> +  + <group><seealso/><text> + <p><ref resolved='predef::functions' to='functions'>functions</ref> and <ref resolved='predef::variables' to='variables'>variables</ref></p> + </text></group> +  + </doc> + </docgroup>   <docgroup homogen-name='mv' homogen-type='method'>   <method name='mv'/><doc placeholder='true'>   <text>
3265:   compile_file() or compile_string(). Programs are only useful as   arguments to clone() and the only operators that applies to programs   are == and !=.</p> + </text>    - types</text> + <group><note/><text> + <p>In uLPC the term 'program' is somewhat confusing, becuase it is used + both to reference a complete runnable software package, and to a + structure in uLPC containing code.</p>    -  + types</text></group> +    <group><seealso/><text>   <p><ref resolved='predef::object' to='object'>object</ref>, <ref resolved='predef::function' to='function'>function</ref>, <ref resolved='predef::compile_file' to='predef::compile_file'>builtin/compile_file</ref>, <ref resolved='predef::compile_string' to='predef::compile_string'>builtin/compile_string</ref> and <ref resolved='predef::clone' to='predef::clone'>builtin/clone</ref></p>   </text></group>
4167:   <tt><p>"foo"<br/>   </p>   </tt> - <p>This type can contain a string, or list of characters, strings can - contain any character, even null characters. Strings are a basic + <p>This type can contan text. ie. a word, a sentence, or a book. Note + that this is not simply the letters A to Z, special characters, + null characters, newlines can all be stored in a string. Any 8-bit + character in fact. Strings are a basic   type in LPC, as opposed to C where strings are represented by an   array of char. This means that you cannot set individual characters   in a string with the index operator for instance. In fact, there are
4176:   are 'shared', that means that if the same string is used in several   places, only one will be stored in memory.   </p> + <p>When writing a string in a program, you enclose it in doublequotes. + To write special characters you need to use one of the following + syntaxes: + </p> + <p><matrix> + <r><c> \n </c><c> newline </c></r> + <r><c> \r </c><c> charriage return </c></r> + <r><c> \t </c><c> tab </c></r> + <r><c> \b </c><c> backspace </c></r> + <r><c> \" </c><c> " </c></r> + <r><c> \\ </c><c> \ </c></r> + </matrix> +  + </p>   <p>A list of operators that applies to strings follow:   In this list a and b is used to represent a string expression:   </p>
4715:   file</text>      <group><seealso/><text> - <p><ref to='read_file'>read_file</ref></p> + <p><ref resolved='predef::read_bytes' to='read_bytes'>read_bytes</ref></p>   </text></group>      </doc>