Channel Elements -- too many attacks?
Moderator: Moderator
1) yes we agree, carriage returns are whitespaces. But .. mh lua does not rely on them .. not at all. You can write all yoru code on one line if you fancy
2) mh
3) Limits being ?
4) Now you're trying to tell me that because you cant botehr to learn a new language somebody should go to some lengths to write a converter for a much less pwoerfull language(C) ? No converter in the world could make smart use of lua niceness, beacuse they just dont exists in C. Now please learn lua or stop throwing silly arguments
2) mh
3) Limits being ?
4) Now you're trying to tell me that because you cant botehr to learn a new language somebody should go to some lengths to write a converter for a much less pwoerfull language(C) ? No converter in the world could make smart use of lua niceness, beacuse they just dont exists in C. Now please learn lua or stop throwing silly arguments
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning

I don't care about LUA niceness. I'd rather be able to do what I want and have the spell cost and failrate info stored somewhere else as they used to be before this LUA fad started than have everything in one place but not be able to do what I want without several lines of fiddling with temporary variables because I can't string together operators because I need one that LUA doesn't have.
Digitochracy
n. 1. technocracy. 2. government by the numbers. 3. rule by people with the longest fingers.
n. 1. technocracy. 2. government by the numbers. 3. rule by people with the longest fingers.
Can you translate these concisely?
What about this statement?
Code: Select all
if ((o_ptr->k_idx) &&
(!artifact_p(o_ptr)) && (!ego_item_p(o_ptr)) &&
(!broken_p(o_ptr)) && (!cursed_p(o_ptr)))
Code: Select all
if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
(r_ptr->level > randint((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
Code: Select all
msg_format("%sour %s (%c) %s destroyed!",
((o_ptr->number > 1) ?
((amt == o_ptr->number) ? "All of y" :
(amt > 1 ? "Some of y" : "One of y")) : "Y"),
o_name, index_to_label(i),
((amt > 1) ? "were" : "was"));
Digitochracy
n. 1. technocracy. 2. government by the numbers. 3. rule by people with the longest fingers.
n. 1. technocracy. 2. government by the numbers. 3. rule by people with the longest fingers.
Well readability of operators is subjective. An operator becomes readable and intuitive when you read it enough.
BenH liked (grokked, indeed) the ? operator and used it a lot. It is, however, in my opinion a fairly small problem. I use it occasionally in C, I don't find it hard to program without it. You could implement it in lua if you wanted to as a function, and just possibly as an overloaded operator with some considerably ingenuity.
Much more interesting are first-class functions with closures. Now that's a programming tool.
There's plenty about LUA that's suboptimal, speaking as someone who only learnt it 3 weeks ago and has been hacking in the ToME code since. But first-class functions and tables are entirely sufficient, IMO, to make it a better programming language for ToME scripts than C.
BenH liked (grokked, indeed) the ? operator and used it a lot. It is, however, in my opinion a fairly small problem. I use it occasionally in C, I don't find it hard to program without it. You could implement it in lua if you wanted to as a function, and just possibly as an overloaded operator with some considerably ingenuity.
Much more interesting are first-class functions with closures. Now that's a programming tool.
There's plenty about LUA that's suboptimal, speaking as someone who only learnt it 3 weeks ago and has been hacking in the ToME code since. But first-class functions and tables are entirely sufficient, IMO, to make it a better programming language for ToME scripts than C.
If someone would implement the trinary conditional operator for LUA I'd stop or at least dramatically curtail my complaining. I still don't like the way it does code blocks (no {..}s) but my biggest complaint is the lack of the ? operator.
Digitochracy
n. 1. technocracy. 2. government by the numbers. 3. rule by people with the longest fingers.
n. 1. technocracy. 2. government by the numbers. 3. rule by people with the longest fingers.
I'm sorry but if you ask somebody who never coded what {} means and what then ... end or do ... end means. I'm sure the lua way will get more right anwsers.
See it even looks better in Lua, less used lines
Code: Select all
if (foo)
{
...
}
else
{
....
}
Code: Select all
if foo then
...
else
...
end
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning

-
- Uruivellas
- Posts: 924
- Joined: Sun Jul 06, 2003 10:04 pm
- Location: A mountain range east of Bree
Look Atarlost, this is getting annoying. Yes, having the game crash because you forgot to put in the "}" is definitely irritating - at least in my opinion - but the C vs. Lua argument has really gone too far. Yes, Lua can be a little annoying, but it really is quite similar to C.
Oh, and sorry about saying that Lua is (shudder) almost as bad as basic, I was annoyed because my game had crashed about 3 times when I tried to fix that geomancy bug I described earlier and forgot to add a 2 commas and a "}".
Oh, and sorry about saying that Lua is (shudder) almost as bad as basic, I was annoyed because my game had crashed about 3 times when I tried to fix that geomancy bug I described earlier and forgot to add a 2 commas and a "}".
WWBD - What Would Bozo Do?
I shouldn't have mentioned curly braces.
My main problem is with the lack of a trinary conditional operator. Jules implies it could be implemented, but that would require someone who knows LUA and can work with the C code for LUA interpretation. There are people here who must know how to do that sort of thing, because they were able to implement the function hooks that do exist for ToME, but I am not one of those people.
My main problem is with the lack of a trinary conditional operator. Jules implies it could be implemented, but that would require someone who knows LUA and can work with the C code for LUA interpretation. There are people here who must know how to do that sort of thing, because they were able to implement the function hooks that do exist for ToME, but I am not one of those people.
Digitochracy
n. 1. technocracy. 2. government by the numbers. 3. rule by people with the longest fingers.
n. 1. technocracy. 2. government by the numbers. 3. rule by people with the longest fingers.