Adrian Perez

lua-users home
wiki

Difference (from prior major revision) (no other diffs)

Changed: 3c3
Currently developing an adventure game engine that will be using Lua as scripting engine: [Lixoo].
== Current Stuff ==

Changed: 5c5,10
== STUFF I MADE: ==
* [SnabbWall] (luajit + Snabb Switch): Application-level firewall suite.

* [ljndpi] (luajit): Binding for the nDPI library.


== Very Old Stuff ==

Removed: 48,50d52
== STUFF I'M MAKING: ==
These are Lua-related projects I'm currently working on:
* Lixoo: the "Lightweight Interpreter eXtensible and Object Oriented", an Open Source 2D adventure game engine. I'm really making a great effort with this. Will be using Lua 5.0 as scripting engine. [Official site].

Changed: 57c59
== STUFF I DIDN'T MAKE YET: ==
== Ideas for Stuff ==

Removed: 62,63d63

* Some kind of mod_lua for [Apache]: I know there's one from [XTG-Systems] floating around there, but it's fairly simple. I know there's CGILua and I recognize it's great... but I'd like to see CGILua running on the Apache included in MacOS X, and there's no binary distribution for Macs. I think also that using an Apache module is faster that using a CGI program; at least this is what happens with [mod_python] and [mod_perl]. It should be nice if it had support for Apache2. Update: I have seen some different mod_lua implementations around there, even for Apache2, great!

Lua user and programmer. Lover of the "small things are beautiful" philosophy.

Current Stuff

Very Old Stuff

        i = 1;
        for line in io.readlines() do
           print(i .. ": ", line);
           i = i+1;
        end

You could do this in one line in C :o) e.g.,
for (int i=1, b[100];;i++) printf("%d: %s\n",i,gets((char*)b));
Or one line in Lua: --NDT
while 1 do i=(i or 0)+1 print(""..i..": "..io.read()) end
  or
for i,ln in function(s,i) return i+1,""..i..": "..io.read() end,nil,1 do print(ln) end

Yeah, you'll right ;), but the C code will crash if you use the program over a file with lines longer than the size of the buffer, and you need to declare the main() function and include stdio.h... Maybe I often worry too much about code correctness and maybe that script was not a good example after all :P -- Adrian

Well.. I don't think any of the last examples given may pass as one line of code. Going like that you can collapse a whole file onto i single line.. Don't get me wrong, I still find it very neat and I like Lua alot :o)

Of course, if terseness is your goal, Perl will win every time: -- ET
while(<>) {print(++$i.": ".$_)}

Heavens! I can't stand Perl, nearly anything I've seen written in Perl seems to me like a bunch of impossible-to-understand-mixed-style-code. But I recognize that your example is unbeatable ;) -- AdrianPerez

Sorry by my interference, but for this problem awk is near invincible (reading from stdin):
awk '{print NR, $0}' -
-- JulioFernandez

Ideas for Stuff

Ideas, ideas: ideas I had but they didn't work, or didn't implement them, or... as I want to work on Lixoo I don't have spare time to these.

I had a go at this one: [moonmake] (documentation: [moonmake.txt]) -- xlq

RecentChanges · preferences
edit · history
Last edited January 25, 2016 8:31 am GMT (diff)