Wiki
Download
Manual
Eggs
API
Tests
Bugs
show
edit
history
You can edit this page using
wiki syntax
for markup.
Article contents:
== Outdated egg! This is an egg for CHICKEN 4, the unsupported old release. You're almost certainly looking for [[/eggref/5/lua|the CHICKEN 5 version of this egg]], if it exists. If it does not exist, there may be equivalent functionality provided by another egg; have a look at the [[https://wiki.call-cc.org/chicken-projects/egg-index-5.html|egg index]]. Otherwise, please consider porting this egg to the current version of CHICKEN. [[tags: eggs]] [[toc:]] == Lua === Introduction This extension embeds the [[http://www.lua.org|Lua]] interpreter into a CHICKEN extension. Source code for the Lua VM is included (version 5.1). === Requires [[dollar]] === API ==== lua-open <procedure> (lua-open) </procedure> Creates and returns a fresh Lua execution context containing all base libraries. ==== lua-close <procedure>(lua-close STATE)</procedure> Closes a Lua execution context and performs all necessary cleanup. The effect of using Lua data from the closed context is undefined. ==== lua-run-string <procedure>(lua-run-string STATE STRING [NAME])</procedure> Executes the Lua statements in {{STRING}} and returns its result(s). The optional argument {{NAME}} can be given to identify the source of the Lua code (used in error messages). ==== lua-run-file <procedure>(lua-run-file STATE PATHNAME)</procedure> Executes the statements in the file designated by {{PATHNAME}} and returns any result(s). ==== lua-eval <procedure>(lua-eval STATE STRING)</procedure> Evaluates the Lua expression in {{STRING}} and returns any result(s). ==== lua-call <procedure>(lua-call LUAFUNCTION ARG ...)</procedure> Calls the Lua function {{LUAFUNCTION}} which must have been obtained through evaluation of Lua code with the given arguments. ==== lua-function? <procedure>(lua-function? X)</procedure> Returns {{#t}} if {{X}} is a Lua function or {{#f}} otherwise. ==== lua-state? <procedure>(lua-state? X)</procedure> Returns {{#t}} if {{X}} is a Lua execution context (as returned by {{lua-open}}) or {{#f}} otherwise. ==== lua-thread? <procedure>(lua-thread? X)</procedure> Returns {{#t}} if {{X}} is a Lua thread or {{#f}} otherwise. ==== lua-table? <procedure>(lua-table? X)</procedure> Returns {{#t}} if {{X}} is a Lua table or {{#f}} otherwise. ==== lua-userdata? <procedure>(lua-userdata? X)</procedure> Returns {{#t}} if {{X}} is a Lua userdata object or {{#f}} otherwise. ==== lua-global-ref <procedure>(lua-global-ref STATE STRING)</procedure> [setter procedure] (set! (lua-global-ref STATE STRING) X) Gets or sets the global variable named by {{STRING}} in the given Lua execution context. ==== lua-table-ref <procedure>(lua-table-ref TABLE KEY)</procedure> [setter procedure] (set! (lua-table-ref TABLE KEY) X) Gets or sets the table element in {{TABLE}} indexed by the Lua value {{KEY}}. === Mapping of Lua results to Scheme values <table> <tr><th>Lua</th><th>Scheme</th></tr> <tr><td>nil</td><td>{{(void)}}</td></tr> <tr><td>number</td><td>number</td></tr> <tr><td>boolean</td><td>boolean</td></tr> <tr><td>string</td><td>string</td></tr> <tr><td>light userdata</td><td>pointer</td></tr> <tr><td>userdata</td><td>userdata record (opaque)</td></tr> <tr><td>function</td><td>procedure</td></tr> <tr><td>thread</td><td>thread record (opaque)</td></tr> <tr><td>table</td><td>table record</td></tr> </table> === Mapping of Scheme arguments to Lua values <table> <tr><th>Scheme</th><th>Lua</th></tr> <tr><td>{{(void)}}</td><td>nil</td></tr> <tr><td>number</td><td>number</td></tr> <tr><td>boolean</td><td>boolean</td></tr> <tr><td>string or symbol</td><td>string</td></tr> <tr><td>char</td><td>string (holding a single character)</td></tr> <tr><td>pointer</td><td>light userdata</td></tr> <tr><td>userdata record</td><td>userdata</td></tr> <tr><td>function</td><td>can not be passed as argument</td></tr> <tr><td>thread record</td><td>thread</td></tr> <tr><td>table record</td><td>table</td></tr> <tr><td>vector or a-list</td><td>table</td></tr> </table> === Authors PUC-Rio, packaged as egg by [[/users/felix winkelmann|felix winkelmann]] === License Lua is licensed under the terms of the MIT license reproduced below. This means that Lua is free software and can be used for both academic and commercial purposes at absolutely no cost. For details and rationale, see http://www.lua.org/license.html . Copyright (C) 1994-2006 Lua.org, PUC-Rio. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. === Version history ; 0.3 : Ported to Chicken 4 ; 0.2 : Lua {{nil}} is handled as {{(void)}} [suggested by John Cowan] ; 0.1 : initial release
Description of your changes:
I would like to authenticate
Authentication
Username:
Password:
Spam control
What do you get when you subtract 9 from 14?