This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
mrpoopy345's profile picture

My own conditional statements

Started by mrpoopy345, 07 March 2014 - 06:46 PM
mrpoopy345 #1
Posted 07 March 2014 - 07:46 PM
Hello! Today, I was wondering if there is any way to make your own statements (If, For, And, etc.)
So, is there any way to?

If you need more info or do not understand, fell free to post and I will give some more info!
Gleeb #2
Posted 07 March 2014 - 07:59 PM
Hey there. Interesting thought you've got there, but… what exactly are you hoping to achieve?
Lyqyd #3
Posted 07 March 2014 - 08:01 PM
What, exactly, are you asking? If you mean, "Is it possible to add new keywords to Lua?" then yes, it is possible. You can't do so from within Lua, of course, but it can be done.
mrpoopy345 #4
Posted 07 March 2014 - 08:24 PM
Yes, lyqd, you are correct. That is what I want to do. But how would I going about doing it?
Lyqyd #5
Posted 07 March 2014 - 08:39 PM
You'd get the source code for a Lua interpreter and add the new keyword. It would probably be a large amount of work. I've never had the desire to do so, so that's all the direction I can really provide.

Why do you want a new keyword? What are you trying to accomplish? What keyword are you wanting to add to accomplish that task, and why?
mrpoopy345 #6
Posted 07 March 2014 - 08:41 PM
I saw the program CCPU and wondered if I could do something like that.