lua-users home
lua-l archive

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


I totally agree with the "iterators" and the "closures" comment. While
I kind of understood iterators before using Lua, I find the concept
much simpler and clearer... and as far as "closures" go, I didn't have
a clue... now they make so much sense... or course, I also think that
being able to pass around functions as first class objects is a
requirement to understanding "closures" (correct me if I am wrong on
that one, I still may have some gray areas that need illuminating).

Don't forget about coroutines... I have written a few programs that
would have been cumbersome (passing pointers in and out of functions,
and being able to stop a function in mid-stream...) in any other
language.

I just wish that my laptop hadn't died on me a week or so ago, I would
like to keep working on the program that I had (I might be able to get
it off the hard drive if it isn't totally dead... yeah, I know,
back-up often...)

Mike

On Sun, Dec 26, 2010 at 6:17 PM, Steve Litt <slitt@troubleshooters.com> wrote:
> Hi all,
>
> Thank you for Lua. I've used it only about 10 days and so far love it. Here's
> why...
>
> It's clean and simple! There's very little syntax to learn because there are
> very few features. The idea of building all complex data on top of tables
> (hashes, linked lists, whatever they're called in other languages) is
> brilliant. Arbitrarily complex data structures can be built easily and
> readably from tables. Starting from 1 instead of 0 reduces the opportunity for
> picket fence errors. Having tables with numeric subscripts plus text data
> fields is so much simpler than having to make a class with an array and
> additional data fields (start, end, length etc). The fact that it's trivial to
> pass functions around like any other data makes for a much easier world, as
> anyone who's done this stuff in C or Perl can tell you.
>
> Learning Lua is like getting a free computer science data structures class. I
> used Ruby for awhile and never understood iterators. A couple days with Lua
> and iterators are obvious. I've read about closures for years and not known
> what they were. A week with Lua solved that.
>
> It's too bad Lua doesn't have static variables like C. Oh wait a minute, you
> can do that with closures, and you can even have multiple identical functions
> each with their own "static variables". Nicely done!
>
> I'm still shaky on metatables and metafunctions, and haven't yet interfaced to
> C. In other words, even without using Lua's best features, I'm already in love
> with the language.
>
> If any of you are in Orlando, Florida, USA on 1/5/2011 the Greater Orlando
> Linux User Group (GoLUG) is having a Lua presentation by Zane Pickett:
>
> http://golug.org/wiki/index.php?title=Main_Page
>
> GoLUG has several game developers who are frothing at the mouth to learn Lua,
> so it's going to be a good meeting. If you're in or near Orlando, we look
> forward to meeting you.
>
> And keep up the good work!
>
> SteveT
>
> Steve Litt
> Recession Relief Package
> http://www.recession-relief.US
> Twitter: http://www.twitter.com/stevelitt
>
>
>