ChanServ changed the topic of #crystal-lang to: The Crystal programming language | https://crystal-lang.org | Fund Crystal's development: https://crystal-lang.org/sponsors | GH: https://github.com/crystal-lang/crystal | Docs: https://crystal-lang.org/docs | Gitter: https://gitter.im/crystal-lang/crystal
brokkoli_origin has quit [Ping timeout: 248 seconds]
brokkoli_origin has joined #crystal-lang
ppw has joined #crystal-lang
ppw has left #crystal-lang [#crystal-lang]
eightthree has quit [Ping timeout: 255 seconds]
eightthree has joined #crystal-lang
Guest99 has joined #crystal-lang
<Guest99> When testing serialising an object to disk and back again, I would like to compare the values in both objects. However, since they contain arrays with other objects `a.should eq b` returns false because those arrays have different addresses.
<Guest99> Here is a very simple test case showing this behaviour: https://bin.gy/nelesiatle
<Guest99> Implementing the equality operator for these objects to descend in their arrays seems like a bad solution because that would require writing new code for every attribute that class has, duplicating information.
<Guest99> (I also haven't found Crystal's version of Python's `any` so I wouldn't even know how to do that either :p)
<Guest99> Any suggestions how I should compare only the values of any two objects? Am I on the right track?
<Guest99> If I could just serialise objects this thing would be trivial, but the trouble is that need this to write the serialisation code!
<Guest99> Feel free to respond even if I am offline BTW, I'll keep an eye on the logs.
Guest99 has quit [Ping timeout: 256 seconds]
brw has quit [Quit: The Lounge - https://thelounge.chat]
brw has joined #crystal-lang
eightthree has quit [Ping timeout: 264 seconds]
eightthree has joined #crystal-lang