lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Sorry, forgot to include the link :)

https://github.com/raksoras/luaw/releases/tag/v1.1.0

Regards,

- Susheel

On Sat, May 30, 2015 at 4:00 AM,  <lua-l-request@lists.lua.org> wrote:
> Send lua-l mailing list submissions to
>         lua-l@lists.lua.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/lua-l-lists.lua.org
>
> or, via email, send a message with subject or body 'help' to
>         lua-l-request@lists.lua.org
>
> You can reach the person managing the list at
>         lua-l-owner@lists.lua.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of lua-l digest..."
>
>
> Today's Topics:
>
>    1. Re: parsing improvement (Lionel Duboeuf)
>    2. pre-usage question (E Radler)
>    3. Re: pre-usage question (KHMan)
>    4. Re: parsing improvement (Sean Conner)
>    5. Re: pre-usage question (Laurent FAILLIE)
>    6. LPEG > 0.10 regression: 'B' (pattern may not have fixed
>       length) (Daurnimator)
>    7. LPeg: captures (????????? ?????)
>    8. Re: parsing improvement (Enrico Colombini)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 29 May 2015 21:30:45 +0200
> From: Lionel Duboeuf <lionel.duboeuf@gmail.com>
> Subject: Re: parsing improvement
> To: Lua mailing list <lua-l@lists.lua.org>
> Message-ID: <5568BE65.9030806@gmail.com>
> Content-Type: text/plain; charset=utf-8; format=flowed
>
> Thanks dirk,
>
>      But as i said, i need to specify a starting position (which doesn't
> exist in gmatch and gsub functions) and can't afford to split my string.
>
>
>
> Le 29/05/2015 21:22, Dirk Laurie a écrit :
>> I usually do it with gsub. Not my own idea, I saw it in
>> some code of Roberto's.
>>
>> t = {}
>> data:gsub(pattern,
>>     function(captures)
>>        t[#t+1] = do_something_with_captures
>>     end)
>>
>> In yiour example, where you want numbers and booleans
>> to be translated, I would do this:
>>
>> item = (function ()
>>     local code = load(item)
>>     if code then return code() end
>> end)() or item
>>
>> If "item" is valid Lua code, it is replaced by its value, otherwise
>> it stays unchanged.
>>
>
>
>
>
> ------------------------------
>
> Message: 2
> Date: Fri, 29 May 2015 21:43:22 +0200
> From: E Radler <radler63@gmail.com>
> Subject: pre-usage question
> To: <lua-l@lists.lua.org>
> Message-ID: <DUB113-DS23EE05DA6DE6E633845A2BC6C90@phx.gbl>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hello,
> I was checking LUA, because chinese boards  based on esp8266 chip say they =
> suport LUA .
> Compared to PC users living with a wealth of library import options and on-=
> line examples for python I fear the experience on an embedded device will b=
> e less fancy for micropython but as well as with LUA . Especially for contr=
> ol algorithms  you will have to start  from scratch using LUA? Is there sup=
> port for http:// GET ? =
>
> The second point is UML round trip support, having code generation. Is ther=
> e some 4 GL SE support for LUA?
>
> thanks
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://listmaster.pepperfish.net/cgi-bin/mailman/private/lua-l-lists.l=
> ua.org/attachments/20150529/5cd4b7a7/attachment-0001.html
>
> ------------------------------
>
> Message: 3
> Date: Sat, 30 May 2015 04:27:58 +0800
> From: KHMan <keinhong@gmail.com>
> Subject: Re: pre-usage question
> To: Lua mailing list <lua-l@lists.lua.org>
> Message-ID: <5568CBCE.5020806@gmail.com>
> Content-Type: text/plain; charset=windows-1252; format=flowed
>
> On 5/30/2015 3:43 AM, E Radler wrote:
>> I was checking LUA, because chinese boards  based onesp8266
>> chipsay they suport LUA .
>
> It's Lua not LUA. You're probably looking at NodeMCU on ESP8266.
> Have you studied the materials at [1]?
>
> [1] http://www.esp8266.com/
>
>> Compared to PC users living with a wealth of library import
>> options and on-line examples for python I fear the experience on
>> an embedded device will be less fancy for micropython but as well
>> as with LUA . Especially for control algorithms  you will have to
>> start  from scratch using LUA? Is there support for http:// GET ?
>
> I think it can do plenty, but remember on-chip SRAM is limited if
> you are not using a separate MCU. "Control algorithms" is pretty
> vague, but hobbyists using NodeMCU for basic IoT-stuff sequencing
> are doing fine. If you need the faster kind of control algorithms,
> just download the SDK+compiler VM image and use gcc.
>
>> The second point is UML round trip support, having code
>> generation. Is there some 4 GL SE support for LUA?
>> thanks
>
> Lua is a scripting language that is often embedded in software
> apps, see [2]. Note it's not "embedded as in MCUs"... It has been
> adapted to run on MCUs with small memory footprints, *however*
> it's still a scripting language that juggles objects and do
> garbage collection. Large apps may use plenty of memory and
> garbage collection is not your usual deterministic memory usage
> scenario.
>
> [2] https://sites.google.com/site/marbux/home/where-lua-is-used
>
> So it's not a purpose-built embedded systems development tool with
> all the UML or 4GL or whatnot tools. I believe it just happened
> that there was a Lua for MCUs -- eLua -- that could be quickly
> ported to ESP8266, creating NodeMCU, which turned out great for
> speedy project development, perfect for the maker demographic,
> which is probably the main target customer for the boards.
>
> --
> Cheers,
> Kein-Hong Man (esq.)
> Kuala Lumpur, Malaysia
>
>
>
>
> ------------------------------
>
> Message: 4
> Date: Fri, 29 May 2015 16:39:30 -0400
> From: Sean Conner <sean@conman.org>
> Subject: Re: parsing improvement
> To: Lua mailing list <lua-l@lists.lua.org>
> Message-ID: <20150529203929.GA5717@brevard.conman.org>
> Content-Type: text/plain; charset=us-ascii
>
> It was thus said that the Great Lionel Duboeuf once stated:
>> hello you all,
>>
>> Just in case i'm doing it not efficiently and to learn best practices:
>> I have a character stream that is formated like this one:
>>
>> ...<6 orange/> <2 20/> <1 1/> <2 20/> <5 false/> <1 0/> <16 orange
>> mechanics/> <2 25/>...
>
>   [ snip ]
>
>> i did some benchmarks, and found using gmatch and iterating trough
>> captures more efficient, but it is not usable when we need to specify a
>> starting offset position (like string.find) and i don't want to split my
>> string to avoid copies.
>>
>> any advices will be very appreciated.
>
>   What you want to do is possible with LPeg.
>
> local lpeg = require "lpeg"
>
> -- To make the following code a bit easier on the eyes
>
> local Ct = lpeg.Ct      -- collect captures in a table
> local Cg = lpeg.Cg      -- assign capture to a field in a table (how I'm using this)
> local Cp = lpeg.Cp      -- capture the current position
> local C  = lpeg.C       -- a generic capture of text
> local S  = lpeg.S       -- match a set of characters
> local P  = lpeg.P       -- match a literal string (see LPeg documentation for more on this)
>
> local token   = (P(1) - P"/")^1       -- match everything up to a '/'
> local bracket = S" \t\n"^0            -- skip 0 or more space characters
>               * P"<"                  -- skip start marker
>               * lpeg.locale().digit^1 -- skip digits; looks like you ignore them
>               * S" \t\n"^1            -- skip one or more space characters
>               * C(token)              -- capture the text we want
>               * P"/>"                 -- skip the end marker
> local pair    = Ct(                   -- collect captures in a table
>                     Cg(bracket,"col1") -- assign this to col1
>                   * Cg(bracket,"col2") -- assign this to col2
>                   )
>               * Cp()                  -- include the current position
>
> local test = [[<6 orange/> <2 20/> <1 1/> <2 20/> <5 false/> <1 0/> <16 orange
> mechanics/> <2 25/>]]
>
> local pos = 1
> while true do
>   local x,npos = pair:match(test,pos)
>   if not x then break end
>   print(x.col1,x.col2)
>   pos = npos
> end
>
>   -spc (From there, it should be easy to wrap it up into an iterator ... )
>
>
>
> ------------------------------
>
> Message: 5
> Date: Fri, 29 May 2015 23:53:11 +0000 (UTC)
> From: Laurent FAILLIE <l_faillie@yahoo.com>
> Subject: Re: pre-usage question
> To: Lua mailing list <lua-l@lists.lua.org>
> Message-ID:
>         <48431168.1770061.1432943591800.JavaMail.yahoo@mail.yahoo.com>
> Content-Type: text/plain; charset="utf-8"
>
> SGksCkkgdGhpbmsgeW91J3JlIHNwZWFraW5nIGFib3V0IG5vZGVtY3UgZnJhbWV3b3JrID9JZiBz
> bywgeW91IHdpbGwgaGF2ZSB0byBjaGVjayBvbiBpdHMgZG9jdW1lbnRhdGlvbiBoZXJlIDogbm9k
> ZW1jdS9ub2RlbWN1LWZpcm13YXJlIAoKfCDCoCB8CnwgwqAgfCAgfCDCoCB8IMKgIHwgwqAgfCDC
> oCB8IMKgIHwKfCBub2RlbWN1L25vZGVtY3UtZmlybXdhcmVub2RlbWN1LWZpcm13YXJlIC0gbHVh
> IGJhc2VkIGludGVyYWN0aXZlIGZpcm13YXJlIGZvciBtY3UgbGlrZSBlc3A4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mVkIHRvIFBDIHVzZXJzIGxpdmluZyB3aXRoIGEgd2VhbHRo
> IG9mIGxpYnJhcnkgaW1wb3J0IG9wdGlvbnMgYW5kIG9uLWxpbmUgZXhhbXBsZXMgZm9yIHB5dGhv
> biBJIGZlYXIgdGhlIGV4cGVyaWVuY2Ugb24gYW4gZW1iZWRkZWQgZGV2aWNlIHdpbGwgYmUgbGVz
> cyBmYW5jeSBmb3IgbWljcm9weXRob24gYnV0IGFzIHdlbGwgYXMgd2l0aCBMVUEgLiBFc3BlY2lh
> bGx5IGZvciBjb250cm9sIGFsZ29yaXRobXPCoCB5b3Ugd2lsbCBoYXZlIHRvIHN0YXJ0wqAgZnJv
> bSBzY3JhdGNoIHVzaW5nIExVQT8gSXMgdGhlcmUgc3VwcG9ydCBmb3IgaHR0cDovLyBHRVQgPyBU
> aGUgc2Vjb25kIHBvaW50IGlzIFVNTCByb3VuZCB0cmlwIHN1cHBvcnQsIGhhdmluZyBjb2RlIGdl
> bmVyYXRpb24uIElzIHRoZXJlIHNvbWUgNCBHTCBTRSBzdXBwb3J0IGZvciBMVUE/wqB0aGFua3MK
> CiAgCi0tLS0tLS0tLS0tLS0tIG5leHQgcGFydCAtLS0tLS0tLS0tLS0tLQpBbiBIVE1MIGF0dGFj
> aG1lbnQgd2FzIHNjcnViYmVkLi4uClVSTDogaHR0cDovL2xpc3RtYXN0ZXIucGVwcGVyZmlzaC5u
> ZXQvY2dpLWJpbi9tYWlsbWFuL3ByaXZhdGUvbHVhLWwtbGlzdHMubHVhLm9yZy9hdHRhY2htZW50
> cy8yMDE1MDUyOS83YTA5NWE2My9hdHRhY2htZW50LTAwMDEuaHRtbAo=
>
> ------------------------------
>
> Message: 6
> Date: Sat, 30 May 2015 11:31:45 +1000
> From: Daurnimator <quae@daurnimator.com>
> Subject: LPEG > 0.10 regression: 'B' (pattern may not have fixed
>         length)
> To: Lua mailing list <lua-l@lists.lua.org>
> Message-ID:
>         <CAEnbY+ffrqhCrWGzTyqHu=fp14OcG_cKECdjumOQiQxJh9qXDg@mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> Trying to use Peter Odding's lxsh
> Issue has been filed for a while over there:
> https://github.com/xolox/lua-lxsh/issues/5
> But this should probably be fixed in LPEG itself?
>
>
> The below works fine with lpeg 0.10:
>
>> lpeg = require"lpeg"
>> D = lpeg.R'09'
>> BB = lpeg.B(-D, 1)
> stdin:1: bad argument #1 to 'B' (pattern may not have fixed length)
>
>
>
> ------------------------------
>
> Message: 7
> Date: Sat, 30 May 2015 14:21:52 +0700
> From: ????????? ?????  <alex.mashin@gmail.com>
> Subject: LPeg: captures
> To: lua-l@lists.lua.org
> Message-ID: <55696510.1080100@gmail.com>
> Content-Type: text/plain; charset=utf-8; format=flowed
>
> Mr Parke,
>
>
>  > How about this, which uses a substitution capture, two function
>  > captures, and two closures?
> Thank you, the solution with function captures works, and I suppose, it
> cannot be done more simply.
>
> Alexander Mashin
>
>
>
> ------------------------------
>
> Message: 8
> Date: Sat, 30 May 2015 10:54:31 +0200
> From: Enrico Colombini <erix@erix.it>
> Subject: Re: parsing improvement
> To: Lua mailing list <lua-l@lists.lua.org>
> Message-ID: <55697AC7.40400@erix.it>
> Content-Type: text/plain; charset=utf-8; format=flowed
>
> On 29-May-15 21:30, Lionel Duboeuf wrote:
>> But as i said, i need to specify a starting position (which doesn't
>> exist in gmatch and gsub functions) and can't afford to split my string.
>
> As an aside, I encountered the same problem when I thought about adding
> features to my 50-line in-memory XML parser (for a small enough
> definition of 'XML', but it could read OpenOffice files).
>
> I always forgot to ask if adding an optional starting point for
> gmatch/gsub would be too costly.
>
> --
>    Enrico
>
>
>
> ------------------------------
>
> _______________________________________________
> lua-l mailing list
> lua-l@lists.lua.org
> http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/lua-l-lists.lua.org
>
>
> End of lua-l Digest, Vol 58, Issue 65
> *************************************