You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 9, 2019. It is now read-only.
cons is the zepto function to append something to the start of a list. It is quite useful for working with lists, even though the behavior of zepto's implementation of this function differs from the standard Scheme implementation.
A few motivating examples of how cons currently works:
Ass you see, its normal type is a dotted list, but it will also work with regular lists. Well, that's nice already, isn't it? But what if we call it without an argument?
(cons) ; explosion!
It will fail! But wait, we just said it has a type associated with it! Wouldn't it make sense to return an empty dotted list then? Well... yes. The only problem with that is that dotted lists cannot be empty. They require at least one element to exist.
Hum... But, what if we do the next best thing then and just return an empty list? That violates the whole "its type is a dotted list" invariant, but it is really muddy to begin with and dotted lists should only be worked with if you really have to (i.e. in really fancy macros).
So, what this RFC proposes is the following behavior: