Page 2 of 2
Re: Lua is annoying sometimes.
Posted: Thu Sep 30, 2010 2:39 pm
by bartbes
kikito wrote:
Robin, bartbes: Is that still correct? Only bmp and tga in screenshots?
As of now? Yes, though there is a ticket in the issue tracker.
@zac352:
Come on, 3 posts?! Get some forum manners!
Re: Lua is annoying sometimes.
Posted: Thu Sep 30, 2010 3:00 pm
by vrld
zac352 wrote:Because I haven't used it in a while, and I'm noticing how simpler (and thus lacking in features) Lua is compared to C++.
Simpler: yes. Lacking features: no. Lua actually quite advanced in terms of what the language supports:
- Anonymous functions.
- Coroutines (you've discovered that already).
- Closures. Try to do that in C++:
Code: Select all
function foo(i) return function() i = i + 1 print(i) end end
a, b = foo(1), foo(100)
a() b() b() a() -- prints 2 101 102 3
- Tail recursion:
Code: Select all
function sum(v, ...) if not v then return 0 end return v + sum(...) end
- Higher order functions:
Code: Select all
function map(f, list) for k,v in pairs(list) do list[k] = f(v) end end
I get the impression you don't like Lua very much because you don't know it well enough.
zac352 wrote:Both came out with division coming before multiplication.
Are you trolling?
a * b / c = (a * b) / c = a * (b / c) = a / c * b = b * a / c = b / c * a= a * b * 1 / c = ...
Re: Lua is annoying sometimes.
Posted: Thu Sep 30, 2010 3:43 pm
by pygy
vrld wrote:
zac352 wrote:Both came out with division coming before multiplication.
Are you trolling?
a * b / c = (a * b) / c = a * (b / c) = a / c * b = b * a / c = b / c * a= a * b * 1 / c = ...
Actually, it is not true with floating point numbers, because of rounding errors. But it doesn't matter most of the time.
Re: Lua is annoying sometimes.
Posted: Thu Sep 30, 2010 3:46 pm
by bartbes
You can't just say "now it has decimals it is no longer true"...
Re: Lua is annoying sometimes.
Posted: Fri Oct 01, 2010 12:46 am
by Jasoco
zac352 wrote:Taehl wrote:What fail. Lua does fully support OoO.
And .bmp is terrible. Use .png instead, since it's better in every single way.
I like png, but love forces me to save in either bmp or tga.
You know your OS has a built-in Screenshot function, right? On Windows it's Print Screen (I think Shift+PrScr to save to a file) and OS X has Command+Shift+3/4. Also, Paint, if you are on Windows, can save files in other formats. There's no excuse at all to upload an oversized BMP file. Especially since there are also countless free image editors and converters out there. This is 2010. The internet age. And BMP is dead. As far as the internets is concerned.
Re: Lua is annoying sometimes.
Posted: Fri Oct 01, 2010 2:09 am
by Diablo
bartbes wrote:kikito wrote:
Robin, bartbes: Is that still correct? Only bmp and tga in screenshots?
As of now? Yes, though there is a ticket in the issue tracker.
@zac352:
Come on, 3 posts?! Get some forum manners!
Unfortunately zac has no concept of multi posting being a bad thing. Don't worry I'll slap him for yall when he does it again. (and he will)
Re: Lua is annoying sometimes.
Posted: Fri Oct 01, 2010 2:46 pm
by zac352
vrld wrote:zac352 wrote:Because I haven't used it in a while, and I'm noticing how simpler (and thus lacking in features) Lua is compared to C++.
Simpler: yes. Lacking features: no. Lua actually quite advanced in terms of what the language supports:
- Anonymous functions.
- Coroutines (you've discovered that already).
- Closures. Try to do that in C++:
Code: Select all
function foo(i) return function() i = i + 1 print(i) end end
a, b = foo(1), foo(100)
a() b() b() a() -- prints 2 101 102 3
- Tail recursion:
Code: Select all
function sum(v, ...) if not v then return 0 end return v + sum(...) end
- Higher order functions:
Code: Select all
function map(f, list) for k,v in pairs(list) do list[k] = f(v) end end
I get the impression you don't like Lua very much because you don't know it well enough.
zac352 wrote:Both came out with division coming before multiplication.
Are you trolling?
a * b / c = (a * b) / c = a * (b / c) = a / c * b = b * a / c = b / c * a= a * b * 1 / c = ...
Lua was my first language. Well, I don't count trying to learn JS when I was 10.