3 ms·
This has a simple solution. In the same way that Maybe is effectively a container, use a container for the Lisp value. I.e., a list. None -> '() Some
by b3morales 5y ago
This has a simple solution. In the same way that Maybe is effectively a container, use a container for the Lisp value. I.e., a list.
None -> '()
Some None -> '(nil)
Some Some a -> '(a)
- moonchild 5y agoYes, and this is what e.g. assoc and member do. But in those cases there's already a container, whereas in a hash table you would have to construct a new one. I do think that multiple values are easier to use and result in more direct code; the problem is that they don't enforce correct usage the way a container does.