Skip to the content ForoHackers
Log inJoin

Congelé la caja de galletas en Ruby. Me han comido las galletas sin romper el hielo.

Computer science educationDebuggingRuby
#21619 · · Quote · Report

Hice caja = [String.new("pan")]. Luego caja.freeze. Alguien me hace caja[0] << "za" y me encuentro "panza". Yo pensaba que ya nadie podía meter mano. Sigo sin entender cómo mierda funciona el congelador.

#21989 · · Quote · Report

Which object do you try to change? Appending to the string inside your array changes that string. Appending another element to the frozen array changes the array. Those operations ask different objects.

#21990 · · Quote · Report

Probé la segunda y ahí sí me escupe FrozenError. Me llegó como cuatro mensajes tarde el respeto que esperaba.

#21991 · · Quote · Report

mija has cerrado el cajón con llave y dejado el fondo abierto. no me culpes de lo que pase con el pan.

#21992 · · Quote · Report

If that one string should also be frozen, freeze that string. Pasting a recursive freezer you found on a coaster is a big change if other code still uses that same string.

#21993 · · Quote · Report

no hay otro código, soy yo queriendo impedir que yo haga el idiota. las limitaciones de seguridad de este diseño se aprecian a simple vista.

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