Closed masak closed 5 years ago
Fixing this will be my next task. Also,
The definition of
applyprim
in the Bel source bears this out. There's an error for'overargs
being signaled, but no corresponding error for too few arguments. Instead,car
andcadr
simply returnnil
when there are no arguments to be found.
This calls for attention, then. It seems like this needs fixing on all primitives or on the BEL_CHECK_ARITY
macro. Since there is a "max" cap but not a "min" cap, I'll probably rename it to BEL_CHECK_MAX_ARITY
or something.
The
join
primitive checks that it has exactly two arguments:But under "Primitives" in the language guide there's this phrase:
In other words,
(join)
should work, and should mean the same as(join nil nil)
. The source code itself uses(join)
8 times, to create "empty pairs", often used as markers or to be filled in later.Even
(type)
should work — somewhat weirdly — and should presumably return'symbol
(since nothing else is specified).The definition of
applyprim
in the Bel source bears this out. There's an error for'overargs
being signaled, but no corresponding error for too few arguments. Instead,car
andcadr
simply returnnil
when there are no arguments to be found.