Edited by MKlegoman357, 12 January 2015 - 07:53 PM.
Lua rants, because we all love it!
#21
Posted 12 January 2015 - 07:44 PM
#22
Posted 12 January 2015 - 09:37 PM
MKlegoman357, on 12 January 2015 - 07:44 PM, said:
anyway, I think Dan has reasons for the removal of those libraries. You'll live without those libraries, they are not life dependant
#23
Posted 12 January 2015 - 09:46 PM
MKlegoman357, on 12 January 2015 - 03:23 PM, said:
What I don't like about CC Lua is the lack of not just the debug library but all Lua's libraries. Literally, why CC doesn't have all the default Lua's libraries. In fact almost every library can be recreated in CC Lua so I do not see why, for example, the io library couldn't be completely added and functional in CC. And the package library with 'require'. And the debug library (allowed by config option). Why Dan? Why??
#24
Posted 12 January 2015 - 10:15 PM
#25
Posted 13 January 2015 - 01:10 AM
Lyqyd, on 12 January 2015 - 10:15 PM, said:
I would love the debug library so that I could, you know, debug. I say it should be a config option so that I can use it for debugging, then distribute a program that doesn't rely on the debug library.
lucy-san, on 12 January 2015 - 02:33 PM, said:
ElvishJerricco, on 12 January 2015 - 08:55 AM, said:
I mean you could. But doing so would require replacing every add instruction with a series of operations that would ultimately just be very slow.
#26
Posted 13 January 2015 - 06:22 AM
lucy-san, on 12 January 2015 - 08:30 AM, said:
Those were two mutually exclusive methods. I'm not sure what you're on about. :|
Let's say "local" is abolished, and you have this:
x = 0 for i=1,10 do x = x + 1 end print x
Is the "x" that we're assigning to within the loop local to that loop, or does it refer to the pre-defined upvalue above the loop? That is to say, does the print statement at the end print 0, or does it print 10?
Let's say it's a new local. In that case, how would you make it refer to the upvalue? By constantly sticking an "upvalue" keyword in front of it? You'd end up typing that more often than you have to type "local" now. Re-assignments to upvalues typically occur far more frequently than new declarations.
Let's say it's the upvalue. What options would you have if you wanted to declare a new variable, short of using a unique title every single time? There goes that flexibility - you'd need to make absolutely sure you don't let your names collide.
These aren't insurmountable problems; but I'm not seeing a solution that isn't worse than the original issue.
#27
Posted 13 January 2015 - 06:30 AM
Bomb Bloke, on 13 January 2015 - 06:22 AM, said:
Yea as it stands, debugging in CC can be a nightmare. I really don't see a reason not have this config option.
#28
Posted 13 January 2015 - 07:51 AM
ElvishJerricco, on 13 January 2015 - 06:30 AM, said:
I thought about re-implementing some elements with bytecode injection. I started some work here, though most of it doesn't work.
Basic description behind it:
What I don't get though is why emulator developers don't add the option for it, even if we don't have it normal ComputerCraft?
Edited by SquidDev, 13 January 2015 - 07:52 AM.
#29
Posted 13 January 2015 - 02:05 PM
Engineer, on 12 January 2015 - 09:37 PM, said:
anyway, I think Dan has reasons for the removal of those libraries. You'll live without those libraries, they are not life dependant
But you have to modify most of the external Lua scripts or libraries if you want to include in your scripts. By saying that 'you can write most of the libraries in plain CC Lua' I meant that if it is possible to do it, why didn't Dan include them? I understand why debug library is dangerous but the package library? It would of course be restricted to local .lua files so C libraries couldn't be loaded but why not to include it at all? At the worst all those libraries could have been rewritten as an API just like io library is now. But why to exclude them completely?
Edited by MKlegoman357, 13 January 2015 - 02:06 PM.
#30
Posted 14 January 2015 - 09:11 AM
Bomb Bloke, on 13 January 2015 - 06:22 AM, said:
Let's say "local" is abolished, and you have this:
x = 0 for i=1,10 do x = x + 1 end print x
Is the "x" that we're assigning to within the loop local to that loop, or does it refer to the pre-defined upvalue above the loop? That is to say, does the print statement at the end print 0, or does it print 10?
Let's say it's a new local. In that case, how would you make it refer to the upvalue? By constantly sticking an "upvalue" keyword in front of it? You'd end up typing that more often than you have to type "local" now. Re-assignments to upvalues typically occur far more frequently than new declarations.
Let's say it's the upvalue. What options would you have if you wanted to declare a new variable, short of using a unique title every single time? There goes that flexibility - you'd need to make absolutely sure you don't let your names collide.
These aren't insurmountable problems; but I'm not seeing a solution that isn't worse than the original issue.
It should refer to upvalue, just as Python and any other normal language does. Reusing names is not a good coding habit.
In normal case you rarely will have to handle more than handful of variables at once - you will have functions, classes and loops, not spaghetti with gotos.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users