From c79b2aabf4022949fe1aed9416c85948f4c11bbf Mon Sep 17 00:00:00 2001 From: MadMaurice Date: Thu, 8 Apr 2021 23:49:04 +0200 Subject: [PATCH] Fix 'and': return nil if it has no operands --- lib/Minilisp.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Minilisp.pm b/lib/Minilisp.pm index 463daa3..a83d491 100644 --- a/lib/Minilisp.pm +++ b/lib/Minilisp.pm @@ -852,6 +852,8 @@ sub macro_and { return sub { my $ctx = shift; + return LISP_FALSE unless @operands_parsed; + my $v = LISP_TRUE; my @operands = @operands_parsed; while (from_lisp_bool($v) && (my $op = shift @operands))