<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.11" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Lua, Lua, Oh, Oh</title>
	<link>http://www.linux-mag.com/id/4678/</link>
	<description>Open Source, Open Standards</description>
	<pubDate>Sat, 04 Jul 2009 12:25:06 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.11</generator>

	<item>
		<title>by: Marcin Owsiany</title>
		<link>http://www.linux-mag.com/id/4678/#comment-748</link>
		<pubDate>Fri, 04 Jan 2008 12:31:21 +0000</pubDate>
		<guid>http://www.linux-mag.com/id/4678/#comment-748</guid>
					<description>heterogeneous: means that something (an object or system) consists of a diverse range of different items.

Sounds like the author confused it with homogeneous.</description>
		<content:encoded><![CDATA[<p>heterogeneous: means that something (an object or system) consists of a diverse range of different items.</p>
<p>Sounds like the author confused it with homogeneous.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: George Rice</title>
		<link>http://www.linux-mag.com/id/4678/#comment-744</link>
		<pubDate>Thu, 03 Jan 2008 19:13:33 +0000</pubDate>
		<guid>http://www.linux-mag.com/id/4678/#comment-744</guid>
					<description>Here's listing two:
&lt;code&gt;

01 #include 
02 #include 
03 #include 
04 #include 
05
06 int main (void) {
07   char buff[256];
08   int error;
09   lua_State *L = lua_open(); /* opens Lua */
10   luaopen_base(L); /* opens the basic library */
11   luaopen_table(L); /* opens the table library */
12   luaopen_io(L); /* opens the I/O library */
13   luaopen_string(L); /* opens the string lib. */
14   luaopen_math(L); /* opens the math lib. */
15 
16   while (fgets(buff, sizeof(buff), stdin) != NULL) {
17     error = luaL_loadbuffer(L, buff, strlen(buff), "line") &#124;&#124;
18     lua_pcall(L, 0, 0, 0);
19     if (error) {
20       fprintf(stderr, "%s", lua_tostring(L, -1));
21       lua_pop(L, 1); /* pop error message from the stack */
22     }
23   }
24 
25   lua_close(L);
26   return 0;
27 }

&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Here&#8217;s listing two:<br />
<code></p>
<p>01 #include<br />
02 #include<br />
03 #include<br />
04 #include<br />
05<br />
06 int main (void) {<br />
07   char buff[256];<br />
08   int error;<br />
09   lua_State *L = lua_open(); /* opens Lua */<br />
10   luaopen_base(L); /* opens the basic library */<br />
11   luaopen_table(L); /* opens the table library */<br />
12   luaopen_io(L); /* opens the I/O library */<br />
13   luaopen_string(L); /* opens the string lib. */<br />
14   luaopen_math(L); /* opens the math lib. */<br />
15<br />
16   while (fgets(buff, sizeof(buff), stdin) != NULL) {<br />
17     error = luaL_loadbuffer(L, buff, strlen(buff), "line") ||<br />
18     lua_pcall(L, 0, 0, 0);<br />
19     if (error) {<br />
20       fprintf(stderr, "%s", lua_tostring(L, -1));<br />
21       lua_pop(L, 1); /* pop error message from the stack */<br />
22     }<br />
23   }<br />
24<br />
25   lua_close(L);<br />
26   return 0;<br />
27 }</p>
<p></code>
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: George Rice</title>
		<link>http://www.linux-mag.com/id/4678/#comment-743</link>
		<pubDate>Thu, 03 Jan 2008 19:09:18 +0000</pubDate>
		<guid>http://www.linux-mag.com/id/4678/#comment-743</guid>
					<description>Here's listing one (I think):
&lt;code&gt;

$ lua 
&#62; -- create an empty table and add some elements 
&#62; t1 = {} 
&#62; t1[1] = "moustache" 
&#62; t1[2] = 3 
&#62; t1["brothers"] = true 
&#62; -- more commonly, create the table and define elements all at once 
&#62; t2 = {[1] = "groucho", [3] = "chico", [5] = "harpo"} 
&#62; t3 = {[t1[1]] = t2[1], accent = t2[3], horn = t2[5]} 
&#62; t4 = {} 
&#62; t4[t3] = "the marx brothers" 
&#62; t5 = {characters = t2, marks = t3} 
&#62; t6 = {["a night at the opera"] = "classic"} 
&#62; -- make a reference and a string 
&#62; i = t3 
&#62; s = "a night at the opera" 
&#62; -- indices can be any Lua value 
&#62; print(t1[1], t4[t3], t6[s]) 
moustache the marx brothers classic 
&#62; -- the phrase table.string is the same as table["string"] 
&#62; print(t3.horn, t3["horn"]) 
harpo harpo 
&#62;-- indices can also be "multi-dimensional" 
&#62; print (t5["marks"]["horn"], t5.marks.horn) 
harpo harpo 
&#62; -- i points to the same table as t3 
&#62; = t4[i] 
the marx brothers 
&#62; -- non-existent indices return nil values 
&#62; print(t1[2], t2[2], t5.films) 
nil nil nil 
&#62; -- even a function can be a key 
&#62; t = {} 
&#62; function t.add(i,j) 
&#62;
&#62; return(i+j) 
&#62;
&#62; end 
&#62; print(t.add(1,2)) 
3 
&#62; print(t[’add’](1,2)) 
3 
&#62; -- and another variation of a function as a key 
&#62; t = {} 
&#62; function v(x) 
&#62;
&#62; print(x) 
&#62;
&#62; end 
&#62; t[v] = "The Big Store" 
&#62; for key,value in t do key(value) end 
The Big Store

&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Here&#8217;s listing one (I think):<br />
<code></p>
<p>$ lua<br />
&gt; -- create an empty table and add some elements<br />
&gt; t1 = {}<br />
&gt; t1[1] = "moustache"<br />
&gt; t1[2] = 3<br />
&gt; t1["brothers"] = true<br />
&gt; -- more commonly, create the table and define elements all at once<br />
&gt; t2 = {[1] = "groucho", [3] = "chico", [5] = "harpo"}<br />
&gt; t3 = {[t1[1]] = t2[1], accent = t2[3], horn = t2[5]}<br />
&gt; t4 = {}<br />
&gt; t4[t3] = "the marx brothers"<br />
&gt; t5 = {characters = t2, marks = t3}<br />
&gt; t6 = {["a night at the opera"] = "classic"}<br />
&gt; -- make a reference and a string<br />
&gt; i = t3<br />
&gt; s = "a night at the opera"<br />
&gt; -- indices can be any Lua value<br />
&gt; print(t1[1], t4[t3], t6[s])<br />
moustache the marx brothers classic<br />
&gt; -- the phrase table.string is the same as table["string"]<br />
&gt; print(t3.horn, t3["horn"])<br />
harpo harpo<br />
&gt;-- indices can also be "multi-dimensional"<br />
&gt; print (t5["marks"]["horn"], t5.marks.horn)<br />
harpo harpo<br />
&gt; -- i points to the same table as t3<br />
&gt; = t4[i]<br />
the marx brothers<br />
&gt; -- non-existent indices return nil values<br />
&gt; print(t1[2], t2[2], t5.films)<br />
nil nil nil<br />
&gt; -- even a function can be a key<br />
&gt; t = {}<br />
&gt; function t.add(i,j)<br />
&gt;<br />
&gt; return(i+j)<br />
&gt;<br />
&gt; end<br />
&gt; print(t.add(1,2))<br />
3<br />
&gt; print(t[’add’](1,2))<br />
3<br />
&gt; -- and another variation of a function as a key<br />
&gt; t = {}<br />
&gt; function v(x)<br />
&gt;<br />
&gt; print(x)<br />
&gt;<br />
&gt; end<br />
&gt; t[v] = "The Big Store"<br />
&gt; for key,value in t do key(value) end<br />
The Big Store</p>
<p></code>
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: mino</title>
		<link>http://www.linux-mag.com/id/4678/#comment-729</link>
		<pubDate>Fri, 21 Dec 2007 20:24:07 +0000</pubDate>
		<guid>http://www.linux-mag.com/id/4678/#comment-729</guid>
					<description>Hi,
Lua is also the eaiest way to develop homebrews for PlayStation Portable. I discovered it that way a few month ago and gave it a try.

nice scripting language.</description>
		<content:encoded><![CDATA[<p>Hi,<br />
Lua is also the eaiest way to develop homebrews for PlayStation Portable. I discovered it that way a few month ago and gave it a try.</p>
<p>nice scripting language.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Jose Castellano</title>
		<link>http://www.linux-mag.com/id/4678/#comment-728</link>
		<pubDate>Fri, 21 Dec 2007 20:14:25 +0000</pubDate>
		<guid>http://www.linux-mag.com/id/4678/#comment-728</guid>
					<description>Hey editors, are you checking the comments? please format the code so it is useful for everyone.

Thanks</description>
		<content:encoded><![CDATA[<p>Hey editors, are you checking the comments? please format the code so it is useful for everyone.</p>
<p>Thanks
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Alexandre Kovalenko</title>
		<link>http://www.linux-mag.com/id/4678/#comment-727</link>
		<pubDate>Fri, 21 Dec 2007 15:59:58 +0000</pubDate>
		<guid>http://www.linux-mag.com/id/4678/#comment-727</guid>
					<description>Introduction could have been lifted verbatim from the Tcl book circa 1990. Amusing... Lua/Tk anyone?</description>
		<content:encoded><![CDATA[<p>Introduction could have been lifted verbatim from the Tcl book circa 1990. Amusing&#8230; Lua/Tk anyone?
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Stuart Prescott</title>
		<link>http://www.linux-mag.com/id/4678/#comment-724</link>
		<pubDate>Thu, 20 Dec 2007 23:16:46 +0000</pubDate>
		<guid>http://www.linux-mag.com/id/4678/#comment-724</guid>
					<description>Editors: Please reformat the code listings so they are readable.</description>
		<content:encoded><![CDATA[<p>Editors: Please reformat the code listings so they are readable.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: ivantorres</title>
		<link>http://www.linux-mag.com/id/4678/#comment-723</link>
		<pubDate>Thu, 20 Dec 2007 22:28:25 +0000</pubDate>
		<guid>http://www.linux-mag.com/id/4678/#comment-723</guid>
					<description>Jet another language!!! (*Signs*) Bored!</description>
		<content:encoded><![CDATA[<p>Jet another language!!! (*Signs*) Bored!
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Andy Tai</title>
		<link>http://www.linux-mag.com/id/4678/#comment-722</link>
		<pubDate>Thu, 20 Dec 2007 21:58:41 +0000</pubDate>
		<guid>http://www.linux-mag.com/id/4678/#comment-722</guid>
					<description>Squirrel (http://squirrel-lang.org/) is a language designed following Lua in its internal architecture but supporting a C/C++ style syntax with classes.  It may be attractive to people who find Lua too minimalistic.</description>
		<content:encoded><![CDATA[<p>Squirrel (http://squirrel-lang.org/) is a language designed following Lua in its internal architecture but supporting a C/C++ style syntax with classes.  It may be attractive to people who find Lua too minimalistic.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Carl Lowenstein</title>
		<link>http://www.linux-mag.com/id/4678/#comment-721</link>
		<pubDate>Thu, 20 Dec 2007 17:15:21 +0000</pubDate>
		<guid>http://www.linux-mag.com/id/4678/#comment-721</guid>
					<description>Programming examples in Listing One and Listing Two have been garbaged up by text reformatting that ignored newlines in the original.  Really hard to decipher.</description>
		<content:encoded><![CDATA[<p>Programming examples in Listing One and Listing Two have been garbaged up by text reformatting that ignored newlines in the original.  Really hard to decipher.
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
