<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.comp.lang.lua.general">
    <title>gmane.comp.lang.lua.general</title>
    <link>http://blog.gmane.org/gmane.comp.lang.lua.general</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.lua.general/99973"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.lua.general/99972"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.lua.general/99971"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.lua.general/99970"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.lua.general/99969"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.lua.general/99968"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.lua.general/99967"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.lua.general/99966"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.lua.general/99965"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.lua.general/99964"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.lua.general/99963"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.lua.general/99962"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.lua.general/99961"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.lua.general/99960"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.lua.general/99959"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.lua.general/99958"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.lua.general/99957"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.lua.general/99956"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.lua.general/99955"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lang.lua.general/99954"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.lua.general/99973">
    <title>Setting LUA_PATH from lua script</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.lua.general/99973</link>
    <description>&lt;pre&gt;Hi all,
       Can we set LUA_PATH from lua script?

Thanks &amp;amp; Regards,
Muqtheear.S
&lt;/pre&gt;</description>
    <dc:creator>Muqtheear S</dc:creator>
    <dc:date>2013-05-22T01:50:58</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.lua.general/99972">
    <title>Re: Function pointer param is always nil</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.lua.general/99972</link>
    <description>&lt;pre&gt;Thanks Geoff, the solution you suggested worked for me.

*class.A()
function A:fun1(val)
    print(val)
end
function A:fun2()
    --return self.fun1;
    return function(...)
        return A:fun1(...)
    end
end
Aobj = A()
fptr = Aobj.fun2()
fptr('man');*


Thanks &amp;amp; Regards,
Muqtheear.S


On Wed, May 22, 2013 at 4:51 AM, Geoff Leyland &amp;lt;geoff_leyland&amp;lt; at &amp;gt;fastmail.fm&amp;gt;wrote:

&lt;/pre&gt;</description>
    <dc:creator>Muqtheear S</dc:creator>
    <dc:date>2013-05-22T00:25:56</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.lua.general/99971">
    <title>Re: Function pointer param is always nil</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.lua.general/99971</link>
    <description>&lt;pre&gt;
This isn't Javascript. Lua doesn't have the concept of bound
functions. Specifically:


This makes fptr reference the function "fun2(self)", not the function
"Aobj.fun2()".

/s/ Adam


&lt;/pre&gt;</description>
    <dc:creator>Coda Highland</dc:creator>
    <dc:date>2013-05-21T23:24:01</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.lua.general/99970">
    <title>Re: Function pointer param is always nil</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.lua.general/99970</link>
    <description>&lt;pre&gt;

You need to pass the Aobj to fptr.  The last line should be: fptr(Aobj, 'man').

Alternatively, fun2 could be

function A:fun2()
    return function(...) return self:fun1(...) end
end

(Since you're using some class library thing, I haven't tested this code)

&lt;/pre&gt;</description>
    <dc:creator>Geoff Leyland</dc:creator>
    <dc:date>2013-05-21T23:21:39</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.lua.general/99969">
    <title>Function pointer param is always nil</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.lua.general/99969</link>
    <description>&lt;pre&gt;Hi all,
        When I execute below code,* fun1* is getting called, but* val* is
always nil(supposed to be 'man'). Please suggest me

*class.A()
function A:fun1(val)
    print(val)
end
function A:fun2()
    return self.fun1;
end
Aobj = A()--creating an object
fptr = Aobj:fun2()
fptr('man');*


Thanks &amp;amp; Regards,
Muqtheear.S
&lt;/pre&gt;</description>
    <dc:creator>Muqtheear S</dc:creator>
    <dc:date>2013-05-21T23:13:30</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.lua.general/99968">
    <title>Re: Problem with table key iteration when string keys areunpredictable</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.lua.general/99968</link>
    <description>&lt;pre&gt;
On May 21, 2013, at 1:24 PM, Philipp Janda &amp;lt;siffiejoe&amp;lt; at &amp;gt;gmx.net&amp;gt; wrote:


Quoting the manual… "Any punctuation character (even the non magic) can be preceded by a '%' when used to represent itself in a pattern."… so… perhaps this can all be simplified to just gsub( '%p', '%%%0' ) )…

For example:

print( ( '1234-5;:/&amp;lt;&amp;gt;.%' ):gsub( '%p', '%%%0' ) )


http://www.lua.org/manual/5.2/manual.html#6.4.1



&lt;/pre&gt;</description>
    <dc:creator>Petite Abeille</dc:creator>
    <dc:date>2013-05-21T18:14:27</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.lua.general/99967">
    <title>Re: Problem with table key iteration when string keys areunpredictable</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.lua.general/99967</link>
    <description>&lt;pre&gt;It was thus said that the Great Philipp Janda once stated:

  Or build up an LPeg expression: http://boston.conman.org/2013/01/14.1

  -spc



&lt;/pre&gt;</description>
    <dc:creator>Sean Conner</dc:creator>
    <dc:date>2013-05-21T17:13:39</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.lua.general/99966">
    <title>Re: Problem with table key iteration when string keys areunpredictable</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.lua.general/99966</link>
    <description>&lt;pre&gt;

function escape( s )
  return string.gsub(s, "[][^$()%%.*+?-]", "%%%0" )
end

1234%-5;:/&amp;lt;&amp;gt;%.%%        3



&lt;/pre&gt;</description>
    <dc:creator>S. Fisher</dc:creator>
    <dc:date>2013-05-21T14:44:18</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.lua.general/99965">
    <title>Re: Problem with table key iteration when string keys areunpredictable</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.lua.general/99965</link>
    <description>&lt;pre&gt;Am 21.05.2013 12:48 schröbte S. Fisher:

Try:

     &amp;gt; =escape( "12345;:/&amp;lt;&amp;gt;%" )
     %1%2%3%4%5%;%:%/%&amp;lt;%&amp;gt;%10

which is probably not what you wanted. So you need to put a few more 
escapes in there (at least before `%`, `.`, and `-`) ...

Philipp


p.s.: Maybe we should have a string.escape() function in Lua's standard 
library (or at least an example in the ref manual ready for copy &amp;amp; 
paste) ...




&lt;/pre&gt;</description>
    <dc:creator>Philipp Janda</dc:creator>
    <dc:date>2013-05-21T11:24:55</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.lua.general/99964">
    <title>Re: Problem with table key iteration when string keys areunpredictable</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.lua.general/99964</link>
    <description>&lt;pre&gt;

--- On Tue, 5/21/13, S. Fisher &amp;lt;expandafter&amp;lt; at &amp;gt;yahoo.com&amp;gt; wrote:



function substitute(s, substitutions)
  local sorted = {}
  for k, _ in pairs( substitutions ) do
    table.insert( sorted, k )
  end
  table.sort( sorted, function (a,b) return #a &amp;gt; #b end )
  for _, key in ipairs( sorted ) do
    s = string.gsub(s, escape(key), substitutions)
  end
  return s
end




&lt;/pre&gt;</description>
    <dc:creator>S. Fisher</dc:creator>
    <dc:date>2013-05-21T10:59:34</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.lua.general/99963">
    <title>Re: Problem with table key iteration when string keys areunpredictable</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.lua.general/99963</link>
    <description>&lt;pre&gt;

--- On Mon, 5/20/13, marbux &amp;lt;marbux&amp;lt; at &amp;gt;gmail.com&amp;gt; wrote:




function escape( s )
  return string.gsub(s, "[][^$()%.*+-?]", "%%%0" )
end

function substitute(s, substitutions)
  sorted = {}
  for k, _ in pairs( substitutions ) do
    table.insert( sorted, k )
  end
  table.sort( sorted, function (a,b) return #a &amp;gt; #b end )
  for _, key in ipairs( sorted ) do
    s,cnt = string.gsub(s, escape(key), substitutions)
  end
  return s
end



&lt;/pre&gt;</description>
    <dc:creator>S. Fisher</dc:creator>
    <dc:date>2013-05-21T10:48:45</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.lua.general/99962">
    <title>Re: Is there a kernel patch for creating local variablesprogrammatically?</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.lua.general/99962</link>
    <description>&lt;pre&gt;

Naturally, this has been done ;)

--- mmath.lua
&lt;/pre&gt;</description>
    <dc:creator>steve donovan</dc:creator>
    <dc:date>2013-05-21T06:59:34</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.lua.general/99961">
    <title>Re: Is there a kernel patch for creating local variablesprogrammatically?</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.lua.general/99961</link>
    <description>&lt;pre&gt;As been said, this is not possible. Lua is not aware what members the 
table has at compile time, locals accesses are generated at compile time 
(that's why I like them so much).
In the case of 'require()' that would actually mean, that Lua must be 
aware of other files at compile time, which it isn't at the moment. 
Currently you can compile Lua scripts each by its own, and actually I 
think that is a nice feature. I am not sure if Lua should give up this 
feature for a "import *" statement. A lot of freedom to give up just to 
avoid some typing.

If Lua really once will get a macro extension, it is highly possible 
that such things would be possible, assuming that the Lua macro language 
will run pre-compilation.
--
Thomas


&lt;/pre&gt;</description>
    <dc:creator>Thomas Jericke</dc:creator>
    <dc:date>2013-05-21T06:14:19</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.lua.general/99960">
    <title>Re: OOP trouble in Lua with Love2d</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.lua.general/99960</link>
    <description>&lt;pre&gt;


...should be % 256 of course.

Regards,
miko



&lt;/pre&gt;</description>
    <dc:creator>Michal Kolodziejczyk</dc:creator>
    <dc:date>2013-05-21T06:13:55</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.lua.general/99959">
    <title>Re: OOP trouble in Lua with Love2d</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.lua.general/99959</link>
    <description>&lt;pre&gt;
I think OP tried to do that (with "Color = {r = 0, g = 0, b = 0} in
first line"), but failed to use this on object creation. Modified code
should be written as:

Color = {r = 0, g = 0, b = 0}

function Color:new(o)
     local o = o or {}
     o.r = (o.r or Color.r) % 255
     o.g = (o.g or Color.g) % 255
     o.b = (o.b or Color.b) % 255
     setmetatable(o, self)
     self.__index = self
     return o;
end

Regards,
miko



&lt;/pre&gt;</description>
    <dc:creator>Michal Kolodziejczyk</dc:creator>
    <dc:date>2013-05-21T06:12:41</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.lua.general/99958">
    <title>Re: Is there a kernel patch for creating local variablesprogrammatically?</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.lua.general/99958</link>
    <description>&lt;pre&gt;That would then mean, you could not use those tables with require as 
require can't know what it will return before it is called. So it can't 
be static const.

Not be able to use require spoils the whole point of an import statement.
--
Thomas


&lt;/pre&gt;</description>
    <dc:creator>Thomas Jericke</dc:creator>
    <dc:date>2013-05-21T06:04:13</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.lua.general/99957">
    <title>Re: Problem with table key iteration when string keys areunpredictable</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.lua.general/99957</link>
    <description>&lt;pre&gt;As you state, in general you want to process the longest keys first. The simplest way to do this is to construct an auxiliary table containing an array where the values are the keys, and then sort this array by length of string (which is just a normal sort, reverse order). Then, index through THIS array when doing the substitution (which will give you the keys, getting the value is easy).

For example:

tSubs = { …. }-- Fill in the strings table as you currently have it
tSubsArray = {}
for k, v in pairs(tSubs) do
table.insert(tSubsArray, k)
end
table.sort(tSubsArray)-- Sorts strings shortest first

function Replace_Substrings_in_String(s, tSubs, tSubsArray)
for ix = #tSubsArray, 1, -1 do-- Reverse order so longest strings (keys) first
local k = tSubsArray[ix]
local v = tSubs[k]
-- Now you have k,v the rest is the same
end
return s
end


On May 20, 2013, at 7:11 PM, marbux &amp;lt;marbux&amp;lt; at &amp;gt;gmail.com&amp;gt; wrote:




&lt;/pre&gt;</description>
    <dc:creator>Tim Hill</dc:creator>
    <dc:date>2013-05-21T04:26:57</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.lua.general/99956">
    <title>Re: Problem with table key iteration when string keys areunpredictable</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.lua.general/99956</link>
    <description>&lt;pre&gt;It was thus said that the Great marbux once stated:

  You could do something like this:

list = {}
repeat
  local key,value = get_next_substitution()
  list[key] = value
  list[#list + 1] = key
until done
table.sort(list,function(a,b) return #a &amp;gt; #b end

  At the end, the array would look like:

list =
{
  ["---"] = "—",
  ["--"] = "–",
  ["sss"] = "§",
  ["ssss"] = "§§",
  ["ppp"] = "¶",
  ["pppp"] = "¶¶",
  [1] = "pppp",
  [2] = "ssss",
  [3] = "---",
  [4] = "ppp",
  [5] = "sss",
  [6] = '--'
}

  With that:

function Replace_Substrings_in_Strings(s,tSubs)
  for i = 1 , #tSubs do
    s = s:gsub(tSubs[i],tSubs[tSubs[i]])
  end
  return s
end

  I also did something similar in LPeg, which goes through the string once. 
I describe it here:

http://boston.conman.org/2013/01/14.1

  -spc



&lt;/pre&gt;</description>
    <dc:creator>Sean Conner</dc:creator>
    <dc:date>2013-05-21T03:32:52</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.lua.general/99955">
    <title>Re: Problem with table key iteration when string keys areunpredictable</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.lua.general/99955</link>
    <description>&lt;pre&gt;Probably you would be better served just turning them into (carefully
ordered) arrays, then.

Either two arrays (say, Keys and Values) that you iterate in parallel or
interleave them (if you want to keep related things next to one another)
like

tSubs = {
     "---", "—", -- em dash
     "--", "–",   -- en dash
 -- etc.

for i = 1, #tSubs, 2 do
  local k, v = tSubs[i], tSubs[i + 1]

&lt;/pre&gt;</description>
    <dc:creator>Steven Johnson</dc:creator>
    <dc:date>2013-05-21T02:30:53</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.lua.general/99954">
    <title>Problem with table key iteration when string keys are unpredictable</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.lua.general/99954</link>
    <description>&lt;pre&gt;Hi, All,

I'm working on an autoreplace script and am hoping for a tip that
might get me past a problem in unpredictability of key names. (Users
enter key/value pairs in a GUI to build a table of strings that will
replace other strings.)

Consider:

 function Replace_Substrings_in_String(s, tSubs)
  for k, v in pairs(s, tSub) do
    s = string.gsub(s, k, v)
  end
 return s
end -- function

tSubs = {
    ["---"] = "—", -- em dash
    ["--"] = "–",   -- en dash
    ["sss"] = "§", -- section
    ["ssss"] = "§§", --- sections
    ["ppp"] = "¶", -- paragraph
    ["pppp"] = "¶¶", -- paragraphs
{

s = Replace_Substrings_in_String(s, tSubs)

(Special characters are UTF-8.)

Because the order in which Lua returns non-array keys is
unpredictable, this type of substitution is problematic. For example,
if Lua returns the key for the en dash (two hyphens) before the key
for the em dash (three hyphens), the script will produce instead of an
em dash an en dash trailed by a hyphen.

I'm particularly concerned with this problem because such
abbreviations are used nearly universally by power users of word
processors and thus the likelihood is high that my users will create
them.

So my question is how I can assure that when multiple abbreviations
share the same leading sequence of identical characters, the keys are
processed in longest to shortest order?  (I don't anticipate any
problems if all keys were processed in longest to shortest order.)

Thanks in advance,

Paul


&lt;/pre&gt;</description>
    <dc:creator>marbux</dc:creator>
    <dc:date>2013-05-21T02:11:49</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lang.lua.general/99953">
    <title>Re: OOP trouble in Lua with Love2d</title>
    <link>http://permalink.gmane.org/gmane.comp.lang.lua.general/99953</link>
    <description>&lt;pre&gt;I would also have initialized the default to { r=0, g=0, b=0 } rather
than {}, to avoid doing a modulo on nil.

/s/ Adam

On Mon, May 20, 2013 at 10:52 AM, Kaj Eijlers &amp;lt;bizziboi&amp;lt; at &amp;gt;gmail.com&amp;gt; wrote:


&lt;/pre&gt;</description>
    <dc:creator>Coda Highland</dc:creator>
    <dc:date>2013-05-20T17:58:36</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.comp.lang.lua.general">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.lang.lua.general</link>
  </textinput>
</rdf:RDF>
