Wesley Smith | 7 Sep 23:47

struct lib

I was looking at the struct lib today.  It seems the examples link is broken:

http://www.inf.puc-rio.br/~roberto/struct/teststruct.lua gives:

teststruct.lua:17: attempt to call global 'loadlib' (a nil value)
stack traceback:
  /opt/kepler/share/lua/5.1/cgilua.lua:153: in function 'loadlib'
  teststruct.lua:17: in main chunk
  [C]: in function 'xpcall'
  /opt/kepler/share/lua/5.1/cgilua.lua:161: in function
  (tail call): ?
  (tail call): ?
  (tail call): ?
  [C]: in function 'xpcall'
  /opt/kepler/share/lua/5.1/cgilua.lua:161: in function 'pcall'
  /opt/kepler/share/lua/5.1/cgilua.lua:606: in function
  [C]: in function 'pcall'
  launcher/mod2/mod2.lua:31: in main chunk

anyone have a copy of it somewhere?

thanks,
wes

Asko Kauppi | 7 Sep 20:18

Accounting with Lua


Some weeks ago, I had a hard disk problem that basically wiped out my  
accounting software (last Windows application I was using). About time.

I considered the options (€ 300 upgrade for the same software) and  
decided to just do it with Lua.

This is only for my own usage (as Linux was for Linus...) but I'd like  
to hear if anyone else is using Lua for their SOHO business or  
personal finances.

I'm using Lua as the data description language for transactions (no  
database), and some hundreds of lines of "main code" create reports  
for monthly and yearly taxation.  Printing bills using LuaCairo (into  
PDF) will be the next stage, and there I shall stop.

-asko

Martin | 7 Sep 13:35

Re: Tools for high level game AI

On Fri, Sep 05, 2008 at 07:34:25PM -0700, Steven Johnson wrote:
> If you don't mind Lisp, chapter 22 of this book has a good summary (#23 and 24 may be useful too):
> 
>   http://paulgraham.com/onlisptext.html
...
> Here's a quick example of the parlor trick with sum 7 (Fig. 22.3 in the book)

I have read that chapters. thanks for pointing them out.
After some code testing (in scheme) I have two question (both about lua):
- When I tried to use your two files I got error:
> /usr/share/lua/5.1/Coroutine.lua:6: attempt to index global 'callops' (a nil \
value)

  Where this module callops can be found?

- Can you show me how to modify your lua parlol example by supplying
  function that will return all possible combinations of two numbers?
  I have been trying to do it in scheme but with no success. I could though
  get them one by one by manually typing (fail).

Martin

Wesley Smith | 6 Sep 21:03

lpeg and terminology

Hi list,
I'm brushing up on LPEG, trying some things out and wrapping my head
around this whole thing.  I'm currently going through the docs and "A
Text Pattern-Matching Tool based on Parsing Expression Grammars"
paper.  What's tripping me up is some of the terminology that's
currently a bit fuzzy to me.  If there's a good resource for getting a
handle on the basic, terminology-wise, I'd love to know about it.

Specifically, what does a phrase like "blind greedy repetition" mean?
I understand greedy to mean look for a mach until there are no more,
but blind is a bit of mystery.  Any info appreciated.
thanks,
wes

Alexander Gladysh | 6 Sep 20:25

Editor controls with Lua API?

Hi, list!

Are there any cross-platform GUI notepad-like editor controls,
scriptable in Lua, besides Scintilla? I need OS X / Linux / Win32
support and UTF-8. As I'm planning some custom usage, I do not need
most of usual fancy features -- just decent flexibility, and good
multi-style text output support (even multicolor-only would do).

On to the other hand, may be I'd prefer to get non-Lua editor control
with clean API (on Lua's level on cleanness ;-) ), and to bind it
myself to suit my needs. Are there any? What I've seen is a bit too
bloated to my taste...

Alexander.

Paul Moore | 6 Sep 16:47

Lua for Take Command, release 1.0

I am pleased to announce the first release of my Lua plugin for JP Software's
Take Command command processor.

What is Lua for Take Command?
-----------------------------

Lua for Take Command (LuaTC hereafter) is a plugin for Take Command
(http://www.jpsoft.com) to embed a Lua (http://www.lua.org) interpreter in the
command processor. LuaTC allows TCC batch files to take advantage of the
powerful Lua scripting language from within TCC.

Why is it different from standalone Lua?
----------------------------------------

Standalone Lua scripts do not have access to the Take Command process, so they
cannot (for example) set environment variables, or run internal TCC commands
without starting a new TCC process. However, LuaTC has direct access to the
TCC API, and can easily do these things.

A simple example, to set a variable from within Lua:

    lua tcc.env["A"]="Set from Lua"

Where can I get it?
-------------------

LuaTC is hosted on Google Code. The project home page is at

    http://lua4nt.googlecode.com

(Continue reading)

LuaCom 1.3: Passing wstrings Around, Running a Message Loop?

Hi, Two newbie Qs on LuaCom 1.3:

1. Can you pass the LuaPlus unicode wstring type to and from COM apps? 
Reading the LuaCom docs it seems to me that unicode strings always get 
downgraded to ANSI, though I haven't tried any strings where it would matter 
just yet.

2. How do you synchronously leave an event loop running and get all the 
events to be either processed in some handler function or called by name in 
a table? In Perl's Win32::OLE I can do:

Win32::OLE->WithEvents($app, $handler);

And I get the $app and methodname as arguments, I think.

Then later, I just say:

Win32::OLE->MessageLoop;

I found a thread that vaguely hints at a StartMessageLoop function in 
LuaCom, but I did not see it documented and did not fully understand from 
the description how to use it. So anye samples of how, say, a stand-alone 
console app can receive events, would be cool. My test app in Perl can do 
that, happily printing the names of event methods it gets called with, 
though I reckon it has to use a separate invisible window for the message 
loop anyway.

--

-- 
With kind regards Veli-Pekka Tätilä
Accessibility, Apps and Coding plus Synths and Music:
(Continue reading)

Peter Romianowski | 6 Sep 08:58

ANN: Log4LUA 0.2 released

Hi,

Log4LUA is (yet another) logging framework. Besides the ability to
actually log things at different levels (DEBUG, INFO, WARN, ERROR,
FATAL) its main features are external configuration, logging categories,
multiple appenders per category and added traceback (stacktrace) 
information. Log entries can be printed to console, logged to a
(rotating) file or send by email.

Version 0.2 is a minor bugfix release.

For more information visit the project homepage at:

http://hscale.org/display/LUA/Log4LUA

Regards,

Peter

Matthew Wild | 6 Sep 05:21

Re: Tools for high level game AI

On Sat, Sep 6, 2008 at 3:34 AM, Steven Johnson <temujin98007 <at> yahoo.com> wrote:
> Hi.
>
>>    I'm wondering if anyone can point me towards tools or sample code for
>> doing things like fuzzy logic, Bayesian reasoning or hierarchical task
>> networks in Lua. Although I get the feeling that HTN just requires a
>> language designed for it. I'm just trying to do a survey of what tools might
>> exist that might do a good job at making decisions inside of my AI, right
>> now my if-then-else clauses aren't quite going to cut it.

Also for fuzzy logic I stumbled upon
http://luaforge.net/projects/luafuzzy/ a while ago.

Matthew.

RJP Computing | 6 Sep 01:04

[ANN] Lua For Windows v5.1.4.17 Official Released

We are proud to announce the next release of Lua for Windows (LfW). Lua is not updated to Lua v5.1.4 and uses the LuaBinaries Lua executable, which allows Lua for Windows to not modify the LUA_PATH or LUA_CPATH environment variables. All known bugs have been fixed so this is an official release. Read the changelog for more information. Enjoy.

Homepage:

Description:
Lua for Windows is a 'batteries included environment' for the Lua scripting language on Windows.

Lua for Windows combines Lua binaries, Lua libraries with a Lua-capable editor in a single install package for the Microsoft Windows operating system. Lua for Windows contains everything you need to write, run and debug Lua scripts on Windows. A wide variety of libraries and examples are included that are ready to use with Microsoft Windows. Lua for Windows runs on Windows 2000 and newer versions of Windows. Lua and its associated libraries are also available for other operating systems, so most scripts will be automatically cross-platform.

Changelog:
09/02/2008 Version 5.1.4.17
* Fixed the readyiss.bat file to work with the new 'lua' directory.

08/29/2008 Version 5.1.4.16 RC1
+ Added wxLua support.
^ Updated to Lua v5.1.4.
^ Changed the 'lualibs' to 'lua' to support the default locations.
^ Updated SciTE property file to make the help show up correctly.
- Removed setting the LUA_PATH and LUA_CPATH environment variables.
________________________________________________________________
Legend: '+' = Addition, '*' = Bug Fix, '-' = Removed, '~' = Move, '^' = Updated
--
Regards,
Ryan
RJP Computing
Ross Berteig | 5 Sep 23:30

Re: LuaRocks with Windows/Visual Studio

Sometime on 9/5/2008, "RJP Computing" <rjpcomputing <at> gmail.com> wrote:
 >On Thu, Sep 4, 2008 at 5:49 PM, Ross Berteig wrote:
 >> ....
 >> In my projects, I follow Steve's list of functions to alias with
 >> macros at compile time, and use a link line that ends with:
 >>
 >>        $(LUADLL) -lgcc -lmsvcr80 $(MSVCR80)
 >> ....
 >
 >How come you need  -lmsvcr80 and $(MSVCR80)? shouldn't $(MSVCR80)
 >be enough? Can you explain a bit more?

Either could have been sufficient, but gcc doesn't seem to get
the linkage even remotely right without any reference to
libmsvcr80.a. If only MSVCR80.DLL is on the link line, the link
has actually satisfied all CRT symbols from MSVCRT.DLL and nearly
completely ignored MSVCR80.DLL.

The 19 functions identified by Steve all have the property that
they are documented in the MSDN with names of the form foo()
along with a companion function named _foo64(), but the functions
actually exported by MSVCR80.DLL are named _foo32() and _foo64().
Unfortunately, MSVCRT.DLL which is linked by libc.a (and/or
libmsvcrt.a) *does* export a function named foo(). Any code which
uses one of those functions (I needed mktime() most recently)
then gets at least part of its runtime from the wrong DLL.

Steve's kludge simply uses #define to map each foo() to _foo32()
at compile time, but now _foo32() is not an exported symbol of
any library in the link unless MSVCR80.DLL is explicitly included.

Even when not touching any of the 19 functions (which must be
aliased in VisualStudio's MSVCR80.LIB to the names actually
exported by the DLL), libgcc.a makes reference to abort(),
_assert(), and memset() and if it is named after libmsvr80.a in
the link command then it seems to get those symbols from
libmsvcrt.a instead. The reliable solution is to move libgcc.a
ahead of libmsvcr80.a in the link line. Alternatively, if the
code being linked itself already references each of those three
symbols then they will be properly satisfied by libmsvr80.a and
all is well.

 >>.... I suppose I ought to go put this into the wiki page... (see
 >> http://lua-users.org/wiki/BuildingModules).
 >Please add this. I would like to study this. I would prefer to
 >use the GCC toolchain.

I added the basic recipe I've worked out to that wiki page. The
real lesson is that if binary compatibility is required (i.e.
when building a DLL for use with LfW) then the builder is
obligated to make certain that binary compatibility is actually
achieved. Dependency Walker is one way to validate that now
unintended dependencies are created. Regression testing is also a
good idea ;-)

One other caution is that executables (both .EXE and .DLL
flavors) built by VS will now (since VC7 I think) include a
manifest in their resource fork. The manifest is written for you
by VisualStudio unless you sieze manual control over it. That
manifest will make a "proper" reference to the C runtime as a
Side by Side assembly.

There are no tools in MinGW that handle that automatically, but
you can write the correct manifest "by hand" along with a
resource script that refers to it. I'll work out the details and
update the wiki page to include that bit of complication.

With the proper manifest, then the C runtime will be
automatically found in the SxS assembly cache and properly
maintained by Windows Update. Lua5.1.dll from LfW has such a
manifest, as does every other DLL they distribute that I checked.

If building and distributing your own application, you would then
be obligated to redistribute the C runtime (probably via
vcredist_x86.exe). However, if you are only building and
distributing components for use with another application, you
have luxury of assuming that the application took care of
installing the C runtime for you, as long as you arrange to use
the *very same* runtime.

 >> ....
 >Yes this dependency should not be forced on Windows. The rocks 
that
 >are available should be built and hosted as binaries that link 
to the
 >VC8 CRT. Thoughts?

Exactly. I do worry about how to future-proof this against the
inevitable move to VC9 or VC10's CRT down the road. I get the
impression that LR's module versioning was not really meant for
that purpose. A separate rocks repository for each runtime might
be the right approach. That is probably a discussion better held
over at the LR list since we are already way off topic here... ;-)

Ross Berteig                               Ross <at> CheshireEng.com
Cheshire Engineering Corp.           http://www.CheshireEng.com/


Gmane