logoalt Hacker News

undershirttoday at 5:41 PM1 replyview on HN

allowing functions to treat nil arguments as empty versions of their expected types


Replies

vayliantoday at 8:01 PM

For example:

(cons some-value my-list)

If my-list is nil, then the above expression will result in a list containing only the element some-value. Otherwise it will be a list starting with some-value followed by any other values that have been previously in my-list.