Author Topic: new to LUA, have several questions  (Read 1950 times)

0 Members and 1 Guest are viewing this topic.

Offline nesmar

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
new to LUA, have several questions
« on: 31 October, 2005, 08:15:28 »
Finding information on LUA is more difficult than most languages so I thought i could ask here. I did find a few anwers, but im not sure if they are correct.

Any help will be appreciated.

1. What is the definition of legal names in LUA? Are name context

2. How the type is specified? When the biding of variable and type takes place?

3. Does your LUA perform static, or dynamic checking? Or both type of

4. Where in the spectrum of weak typed language to Strong typed language is LUA?

5. Examples or cases where LUA is weak on checking the variable

6. Does LUA allow static variables?

7. Does LUA allow stack-Dynamic variables?

8. Does LUA allow Heap-Dynamic variables?

9. Type of scoping of in LUA.

10. Primitive data types in LUA.

11. How char, strings, and Booleans are handled, (design issues, their operations).

12. How strings are checked?

13. Does LUA provide support for enumeration types?

14. How Arrays are supported? (Design issues, static/dynamic, associative, multidimensional, etc) How are they checked? Are rectangular, and jagged arrays allowed? Does LUA have special features supporting arrays?

15. What about records? How reliable are they?

16. Pointers and reference type, design issues, scope, dynamic storage management.

PtokaX forum

new to LUA, have several questions
« on: 31 October, 2005, 08:15:28 »

Offline Rincewind

  • Scripter
  • Lord
  • ******
  • Posts: 403
  • Karma: +60/-7
    • Rincewind's Scripts
(No subject)
« Reply #1 on: 31 October, 2005, 09:47:20 »
Check out here  for details on Lua

Offline plop

  • Forum God
  • ****
  • Posts: 2 464
  • Karma: +37/-0
(No subject)
« Reply #2 on: 31 October, 2005, 19:11:54 »
lua gets it's speed from simplicity, there are just variables.
you never have 2 declare the type, but you can check what type it is.

variable isn't the same as Variable.

inside lua arrays are the same as table, indexed by numbers.
on the tables you have total freedom, you can mix all types in any way you like.
tTable = { var, { [1] = var1, [28] = var28}, 374, ["string"] = {var2, var3, 384, string, {something, somethingelse} } }
lua doesn't mind what you do.
but lua has optimized loop functions for both arrays and tables (ipairs/pairs).

from the inside lua is mostly a huge table, and these tables give lua it's speed.
hence string.find, string.sub, etc...
use tables are much as possible 2 get max speed.
a global table works as fast as a local vallue.

when ever you try 2 do math on a string lua will try 2 convert it into a number, but for safety you should always do it yourself.

Booleans are handled a bit different then most other languages.
false is a vallue but handled as nil.
if bBool then

« Last Edit: 31 October, 2005, 19:13:09 by plop » lua scripts/howto\'s.

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

Offline Corayzon

  • Lord
  • ***
  • Posts: 464
  • Karma: +1/-0
(No subject)
« Reply #3 on: 31 October, 2005, 19:39:21 »
Lua 5.0 Reference Manual

Code: [Select]
5 - Standard Libraries

5.1 - Basic Functions
5.2 - Coroutine Manipulation
[COLOR=red]5.3 - String Manipulation [/COLOR]  
[COLOR=red]5.4 - Table Manipulation[/COLOR]  
5.5 - [COLOR=red]Mathematical Functions[/COLOR]  
5.6 - Input and Output Facilities
5.7 - Operating System Facilities
5.8 - The Reflexive Debug Interface

PtokaX forum

(No subject)
« Reply #3 on: 31 October, 2005, 19:39:21 »