Learn Lua in 15 Minutes
71–80 of 99 posts
Re: Learn Lua in 15 Minutes
#72I'm going to be "that guy": -- These are the same: -- ...snip... local function g(x) return math.sin(x) end local g = function (x) return math.sin(x) end According to the Lua Reference Manual [1], this example isn't correct. Rather, this is the correct translation: local function g(x) return math.sin(x) end local g; g = function (x) return math.sin(x) end From the manual: "This only makes a difference when the body o…
You're right; I fixed that part.
Re: Learn Lua in 15 Minutes
#73Great sheet. -- Variables are global by default. thisIsGlobal = 5 -- Camel case is common. -- Undefined variables return nil. -- This is not an error: foo = anUnknownVariable -- Now foo = nil. -- Only nil and false are falsy; 0 and '' are true! Didn't read further. Bad language design. Must die.
Re: Learn Lua in 15 Minutes
#74I would like to say that the easiest way for me to learn lua really fast was to build games with Corona using lua. Having a great tool that gives great feedback right away makes learning a language more fun IMO.
Since I became a Lua programmer, I really can't stand any other languages, and I've rapidly switched to it for my scripting needs. Tables are just soooo lovely. ;)
Re: Learn Lua in 15 Minutes
#75Earlier quoted context omitted.
Well, it helps a lot that Lua is by design a very small language :) Python is actually much bigger nowadays -- I would challenge someone to come up with something this simple that doesn't leave out a lot of stuff you will encounter in real code. The extra features ("bloat") do matter. I like the idea of Lua a lot, but when I started programming in it, it unfortunately felt like a less capable Python to me.
I'm sure you're aware of Penlight, which does a very nice job of providing a "batteries included" library similar to Python's for Lua.
Re: Learn Lua in 15 Minutes
#76Re: Learn Lua in 15 Minutes
#77Re: Learn Lua in 15 Minutes
#78It was interesting to find resemblance of Lua's classes to Perl's blessing. Always meant to look into the language and this tutorial made me do it.
I also learned about the LÖVE game engine, which I'm going to play with this week. Thank you!
Re: Learn Lua in 15 Minutes
#79Earlier quoted context omitted.
What do you want to do that you cannot do because of the lack of Unicode support?
I'd imagine internationalized gamed would be a big one, although I'm not a games programmer or a lua user myself.
Re: Learn Lua in 15 Minutes
#80Having a font size of 25.33pt makes the website impossible to read without zooming out 3 steps. I would be happy if people stopped using tiny and huge default font sizes.