new to LUA, have several questions
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

new to LUA, have several questions

Started by nesmar, 31 October, 2005, 08:15:28

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nesmar

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
sensitive?

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
checking?

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
types.

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.

Rincewind

Check out here  for details on Lua

plop

#2
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.
type(variable)

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

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

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

Corayzon

Lua 5.0 Reference Manual

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

SMF spam blocked by CleanTalk