3 ms·
Would that mean I'd need to carry the `:null` symbol all throughout the codebase, wherever that data-structure might be accessed?
by s_kilk 10y ago
Would that mean I'd need to carry the `:null` symbol all throughout the codebase, wherever that data-structure might be accessed?
- aidenn0 10y agoI'm not sure I understand the question. If you need to check if a value is null, you compare it with :null. It does mean that values you are going to serialize out to JSON should use :null rather than the more lispy nil, but JSON interfaces where you are required to send null values are quite rare (in fact I don't recall ever encountering one), so it hasn't been a problem for me in practice.
- db48x 10y agoSymbols are interned, and become a simple integer comparison once compiled. It's no different than comparing against 0, except that :null will have some other non-zero value.