Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Adding weak references to CHICKEN (more-magic.net)
30 points by todsacerdoti on June 30, 2023 | hide | past | favorite | 1 comment


TXR Lisp uses weak hash tables for mapping code to file/line information.

Hash tables support four flavors of weakness: weak key, weak value, weak key AND value, weak key OR value.

For source code location info tables, we want the keys to be weak (if the code becomes garbage, we want the table to drop the source location info). However, that table will usually hold the only reference to the source location info, and so values must be "strong".




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: