Hi everyone. I have no idea what a table is. I know what a database table is. But not what a lua table is.
Can you please tell me what a table is?
What is a table?
Started by FoxData, Mar 15 2016 03:50 PM
7 replies to this topic
#1
Posted 15 March 2016 - 03:50 PM
#2
Posted 15 March 2016 - 04:16 PM
You're on the internet, there are plenty of sites which explain it. You just have to do a quick Google search. If you have questions about certain aspects, we're happy to answer them, but I doubt anyone would take the time to write up a post explaining the entire concept of tables.
#3
Posted 15 March 2016 - 04:46 PM
A lua table is something between a hashmap and an array.
In essence, a table associates two things. For example, a number with a string. Or vice versa. The value can be anything, a function, a coroutine, even another table!
Tables are useful when you want to organize some things. All APIs are actually tables, when you call os.pullEvent you are indexing the table os, with they key "pullEvent". The function associated with that key is then called.
Tables are also useful when you have an unknown or large amount of values to store. For example, if I was to create a coroutine manager, I would need to store whichever programs the user might launch. However, I don't know how many will be active at any given point.
Ignore this:
This just doesn't make any sense.
Is this the proper response?
In essence, a table associates two things. For example, a number with a string. Or vice versa. The value can be anything, a function, a coroutine, even another table!
Tables are useful when you want to organize some things. All APIs are actually tables, when you call os.pullEvent you are indexing the table os, with they key "pullEvent". The function associated with that key is then called.
Tables are also useful when you have an unknown or large amount of values to store. For example, if I was to create a coroutine manager, I would need to store whichever programs the user might launch. However, I don't know how many will be active at any given point.
Ignore this:
everyOS, on 15 March 2016 - 05:23 PM, said:
A table is an index where you can store multiple items
This just doesn't make any sense.
Luca_S, on 22 March 2016 - 08:32 PM, said:
Ok this is scary at 05:46 PM you quoted something that was said at 06:23 PM
Edited by KingofGamesYami, 22 March 2016 - 10:27 PM.
#4
Posted 15 March 2016 - 05:23 PM
A table is an index where you can store multiple items
#5
Posted 22 March 2016 - 08:32 PM
KingofGamesYami, on 15 March 2016 - 04:46 PM, said:
A lua table is something between a hashmap and an array.
In essence, a table associates two things. For example, a number with a string. Or vice versa. The value can be anything, a function, a coroutine, even another table!
Tables are useful when you want to organize some things. All APIs are actually tables, when you call os.pullEvent you are indexing the table os, with they key "pullEvent". The function associated with that key is then called.
Tables are also useful when you have an unknown or large amount of values to store. For example, if I was to create a coroutine manager, I would need to store whichever programs the user might launch. However, I don't know how many will be active at any given point.
Ignore this:
This just doesn't make any sense.
In essence, a table associates two things. For example, a number with a string. Or vice versa. The value can be anything, a function, a coroutine, even another table!
Tables are useful when you want to organize some things. All APIs are actually tables, when you call os.pullEvent you are indexing the table os, with they key "pullEvent". The function associated with that key is then called.
Tables are also useful when you have an unknown or large amount of values to store. For example, if I was to create a coroutine manager, I would need to store whichever programs the user might launch. However, I don't know how many will be active at any given point.
Ignore this:
everyOS, on 15 March 2016 - 05:23 PM, said:
A table is an index where you can store multiple items
This just doesn't make any sense.
Ok this is scary at 05:46 PM you quoted something that was said at 06:23 PM
#7
Posted 22 March 2016 - 11:33 PM
Lock this thread
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users











