Is it a bad idea to store a lamda in a record? I'm storing a function in a record, and then storing the record in a dict, and it's doing all kind of crazy things. If I change the size of another constant in the record from 16-32-64 bits it gets stranger. Varies from panics to segfaults to making other values in the record go crazy.
Just not sure if that is me doing the wrong thing. I feel like I should be able to store a lambda in a record.
Yeah, you should be able to store lambdas in records
How are you testing that the values are going crazy?
I'm using dbg to inspect the state of the dict. I can share my code later.
There is a pretty decent chance that the issue is with dbg
and not with the record going crazy
I have seen debug print totally incorrect results with dictionaries
and records in general
But if I take a field, convert it to str, and then debug print, it will be the normal value that I expect
I think debug may have some bugs where it decodes wrong.
Definitely worth filing issues so we can try and fix this.
Last updated: Jul 06 2025 at 12:14 UTC