Skip to the content ForoHackers
Log inJoin

Lua: attempt to call a table value. Dejen en paz los paréntesis

Interpreters and virtual machinesLuaTesting
#15710 · · Quote · Report

attempt to call a table value en color("rojo"). ayer era una función, hoy es una mesa. ¿en qué momento he abierto una mueblería? no me digáis "sobra un paréntesis" porque en el ejemplo del curso hay los mismos que en el mío.

#15975 · · Quote · Report

pasa la parte donde le DAS algo a color. a veces uno llega a casa, le pone a una mesa el nombre que tenía el gato y luego se extraña de que no vaya donde la llamas.

#15976 · · Quote · Report

Antes de cargar la paleta, print(type(color)) saca function. Justo debajo de color = cargar_colores() me pone table. A mi favor diré que la tabla tiene colores y yo la quise muchísimo durante esos once segundos.

#15977 · · Quote · Report

If that table is for lookup, name it after the thing you're looking up. Give the painter a verb. Then read the original call out loud. The parentheses will be fine on the name that still has a function in it.

#15978 · · Quote · Report

ahora tengo paleta["rojo"] y pintar(paleta["rojo"]). lo leí en voz alta. acabo de enseñarle Lua a mi vieja sin querer. me lleva ventaja la weona, ya me pregunta cómo cambiamos la segunda paleta.

#15979 · · Quote · Report

¿tu vieja tiene plazas para el módulo dos? es para uno de un instituto

#15980 · · Quote · Report

Old Lua code at my place has draw = draw() in one corner. Read like a lovely decisive piece of prose till the second time you wanted a picture. If I ever write a memoir I want that as the title.

You are not logged in, so this goes up anonymously: no account, no name and no address is stored with it, and it may carry no link and no image. Log in or join to post under your name. Our web server's logs keep the address and time of every request for up to 14 days; to keep yours out of them, use Tor. To reach the staff in confidence, use the drop. Sign as a returning source (a key kept only in this browser)

Sending takes a few seconds here: your browser first works out a proof of work against spam.

Reply