On Dec 6, 2006, at 12:45 PM, chris bohnert wrote:
Those interested in taking Josh up on his quest of producing a
bittorrent
external might check out the conspicuously named "libtorrent" from
the guys
at Rasterbar. I use their luabind library for all my lua external
needs and
it works great.
Lua seems a very attractive language. What do you use it for? Any
relation to your Rev work?
I particularly appreciated the following (from <http://
en.wikipedia.org/wiki/Lua_programming_language>):
Table as structure
Tables are often used as structures (or objects) by using strings as
keys. Because such use is very common, Lua features a special syntax
for accessing such fields.
Example:
point = { x = 10, y = 20 } -- Create new table
print( point["x"] ) -- Prints 10
print( point.x ) -- Has exactly the same meaning as line
above
Table as array
By using a numerical key, the table resembles an array data type.
A simple array of the strings:
array = { "a", "b", "c", "d" } -- Indexes are assigned automatically
print( array[2] ) -- Prints "b"
An array of objects:
function Point(x,y) -- "Point" object constructor
return {x = x, y = y} -- Creates and returns a new object (table)
end
array = { Point(10,20), Point(30,40), Point(50,60) } -- Creates
array of points
print( array[2].y ) -- Prints 40
t
--
Tereza Snyder
Califex Software, Inc.
www.califexsoftware.com
_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution