masak / bel

An interpreter for Bel, Paul Graham's Lisp language
GNU General Public License v3.0
27 stars 1 forks source link

Add test file for odd 'hug' calls #301

Closed masak closed 3 years ago

masak commented 3 years ago

The hug function itself takes a list like (a b c d) and gives back a list of 2-element lists: ((a b) (c d)). Good for pairing things up. This function itself is tolerant to an odd, unpaired element at the end: (a b c d e) gives back ((a b) (c d) (e)).

But built-in functions and macros that use hug vary in their tolerance to odd-length lists. Many of them have a default, like nil or t (which we test here); others simply fail by giving a more or less cryptic underargs error (which we also test).