<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>t+1 - Latest Comments in Lua metatable examples</title><link>http://tplus1.disqus.com/</link><description></description><atom:link href="https://tplus1.disqus.com/lua_metatable_examples/latest.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Thu, 08 Oct 2009 06:11:51 -0000</lastBuildDate><item><title>Re: Lua metatable examples</title><link>http://blog.tplus1.com/blog/2007/10/03/lua-metatable-examples/#comment-19488334</link><description>&lt;p&gt;Thanks for posting Lua metatable example.I was looking for it..........&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">williamrobert30</dc:creator><pubDate>Thu, 08 Oct 2009 06:11:51 -0000</pubDate></item><item><title>Re: Lua metatable examples</title><link>http://blog.tplus1.com/blog/2007/10/03/lua-metatable-examples/#comment-10366502</link><description>&lt;p&gt;Wow -- that 3d engine sounds really neat!  Thanks for the tip.  I will&lt;br&gt;have to look at that.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Matt Wilson</dc:creator><pubDate>Mon, 01 Jun 2009 17:57:35 -0000</pubDate></item><item><title>Re: Lua metatable examples</title><link>http://blog.tplus1.com/blog/2007/10/03/lua-metatable-examples/#comment-10364503</link><description>&lt;p&gt;I don't know whether you heard about it, but there's a nice opensource 3d engine using Lua. (You don't have to write C code at all.) Physics simulation is integrated as well (ODE). It's called Apocalyx. It ships with a handful of demos. (They're quite straightforward, you can learn the usage of the engine just by modifying them.) It's very easy to use, and that is the main reason I'm learning Lua.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">zslevi</dc:creator><pubDate>Mon, 01 Jun 2009 17:02:26 -0000</pubDate></item><item><title>Re: Lua metatable examples</title><link>http://blog.tplus1.com/blog/2007/10/03/lua-metatable-examples/#comment-10363748</link><description>&lt;p&gt;It produces the following output:&lt;/p&gt;&lt;p&gt;apple	green&lt;br&gt;------&lt;br&gt;asas&lt;br&gt;green&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">zslevi</dc:creator><pubDate>Mon, 01 Jun 2009 16:40:59 -0000</pubDate></item><item><title>Re: Lua metatable examples</title><link>http://blog.tplus1.com/blog/2007/10/03/lua-metatable-examples/#comment-10363715</link><description>&lt;p&gt;I have experimented a little bit with metatables, and found it intresting that the values in metatables doesn't show up in foreach.&lt;/p&gt;&lt;p&gt;a={apple="green"}&lt;br&gt;b={cucc="asas"}&lt;br&gt;setmetatable(a, {__index = b})&lt;br&gt;for k,v in pairs(a) do print(k,v) end&lt;br&gt;print("------")&lt;br&gt;print(a.cucc)&lt;br&gt;print(&lt;a href="http://a.apple" rel="nofollow noopener" target="_blank" title="a.apple"&gt;a.apple&lt;/a&gt;)&lt;/p&gt;&lt;p&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">zslevi</dc:creator><pubDate>Mon, 01 Jun 2009 16:39:59 -0000</pubDate></item><item><title>Re: Lua metatable examples</title><link>http://blog.tplus1.com/blog/2007/10/03/lua-metatable-examples/#comment-10359181</link><description>&lt;p&gt;Oh -- sorry, I don't know of any other examples.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Matt Wilson</dc:creator><pubDate>Mon, 01 Jun 2009 15:11:34 -0000</pubDate></item><item><title>Re: Lua metatable examples</title><link>http://blog.tplus1.com/blog/2007/10/03/lua-metatable-examples/#comment-10356743</link><description>&lt;p&gt;I meant double indirection in Lua. &lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">zslevi</dc:creator><pubDate>Mon, 01 Jun 2009 14:02:59 -0000</pubDate></item><item><title>Re: Lua metatable examples</title><link>http://blog.tplus1.com/blog/2007/10/03/lua-metatable-examples/#comment-10351238</link><description>&lt;p&gt;Double indirection shows up all over the place.  In this case, a failed lookup on the first table goes to the metatable.  That's the first indirection.  The second indirection happens when the metatable uses the __index to handle the lookup.&lt;/p&gt;&lt;p&gt;Filesystems that use inodes can use double indirection too.  That might be a good place to study it.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Matt Wilson</dc:creator><pubDate>Mon, 01 Jun 2009 10:07:26 -0000</pubDate></item><item><title>Re: Lua metatable examples</title><link>http://blog.tplus1.com/blog/2007/10/03/lua-metatable-examples/#comment-10330812</link><description>&lt;p&gt;Can you name other uses of double indirection, or it is restricted to metatables?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">zslevi</dc:creator><pubDate>Sun, 31 May 2009 21:49:49 -0000</pubDate></item><item><title>Re: Lua metatable examples</title><link>http://blog.tplus1.com/blog/2007/10/03/lua-metatable-examples/#comment-10325026</link><description>&lt;p&gt;Yeah, I wrote this post after spending many hours playing with&lt;br&gt;metatables until I finally felt like I understood them.  It took me a&lt;br&gt;long time before the double-indirection seemed logical.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Matt Wilson</dc:creator><pubDate>Sun, 31 May 2009 16:52:07 -0000</pubDate></item><item><title>Re: Lua metatable examples</title><link>http://blog.tplus1.com/blog/2007/10/03/lua-metatable-examples/#comment-10318829</link><description>&lt;p&gt;I checked out your link and now it seems more clear:&lt;br&gt;"&lt;br&gt;The use of the __index metamethod for inheritance is so common that Lua provides a shortcut. Despite the name, the __index metamethod does not need to be a function: It can be a table, instead. When it is a function, Lua calls it with the table and the absent key as its arguments. When it is a table, Lua redoes the access in that table. &lt;br&gt;"&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">zslevi</dc:creator><pubDate>Sun, 31 May 2009 13:39:03 -0000</pubDate></item><item><title>Re: Lua metatable examples</title><link>http://blog.tplus1.com/blog/2007/10/03/lua-metatable-examples/#comment-10318565</link><description>&lt;p&gt;Wow, it still seems a bit voodoo. It seems, as if a metatable were a function.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">zslevi</dc:creator><pubDate>Sun, 31 May 2009 13:35:20 -0000</pubDate></item></channel></rss>