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

Bug In Aliasing Of Colors To Colours?

Started by Hawk777, 20 February 2012 - 07:01 PM
Hawk777 #1
Posted 20 February 2012 - 08:01 PM

lua> colors.white
1
lua> colors.orange
2
lua> colours.white
1
lua> colours.orange
2
lua> colors.combine
function: 70f4d063
lua> colors.combine(1, 2)
3
lua> colours.combine
function: 6f30d50a
lua> colours.combine(1, 2)
attempt to call nil
lua>

What in the HECK!?
Advert #2
Posted 20 February 2012 - 08:50 PM
I'm getting this too; there seems to be some error in the colours.* functions.

Use colors instead; this won't error.
Hawk777 #3
Posted 20 February 2012 - 08:57 PM
I realize that, and will do so if I need to; I happen to prefer my spelling and would like to see the bug fixed at some point (though I'm not even sure how it happened, since "colours.combine" is a function but calling it gives "attempt to call nil"). This is more of a bug report than a call for help ;)/>/>
Advert #4
Posted 20 February 2012 - 08:59 PM
You can temporarily alleviate this problem by doing this:

colours = colors
Put it at the top of your programs, and you should be set ;)/>/>
Hawk777 #5
Posted 21 February 2012 - 05:31 AM
Yeah that's a good point actually, except for the now-erroneous spelling of "grey" as "gray" (similarly for lightGrey). I'm curious why not just include both spellings of "grey" in the "colors" package and then make "colours" be a directly alias? I'd have thought that would be a whole lot easier.
Advert #6
Posted 21 February 2012 - 11:14 AM
Yeah that's a good point actually, except for the now-erroneous spelling of "grey" as "gray" (similarly for lightGrey). I'm curious why not just include both spellings of "grey" in the "colors" package and then make "colours" be a directly alias? I'd have thought that would be a whole lot easier.
It would break

for k, v in pairs(colors)
print("Color: ", k, " value: ", v) - with both grey and gray, that would be printed twice.
end
Hawk777 #7
Posted 22 February 2012 - 12:32 AM
Ahhh, didn't realize people did that. Makes sense. Since bundled cables aren't likely to change any time soon, what about just making them completely independent?