Shen-Language / shen-cl

Shen for Common Lisp (Unmaintained)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't compare empty absvectors

rkoeninger opened this issue · comments

The CF-VECTORS function should check if both vectors are empty and immediately return true if so.

shen-cl/src/primitives.lsp

Lines 160 to 163 in 3439aff

(DEFUN CF-VECTORS (X Y LX LY)
(AND
(= LX LY)
(CF-VECTORS-HELP X Y 0 (1- LX))))

Didn't test it, but I think this version should work without adding much overhead.

(DEFUN CF-VECTORS (X Y LX LY)
  (AND
    (= LX LY)
    (OR (ZERO? LX)
        (CF-VECTORS-HELP X Y 0 (1- LX)))))

Well, probably not ZERO?, thats a Scheme thing, but whatever Common Lisp has.

It's ZEROP.

Fixed in this commit: 96004d1

Tests pass. Tried it out and it no problems.