apl: enclose ⊂ / disclose ⊃; 82/82 tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-06 19:17:30 +00:00
parent ad914b413c
commit e06e3ad014
3 changed files with 65 additions and 4 deletions

View File

@@ -474,4 +474,44 @@
(apl-test
"grade-up single element"
(rv (apl-grade-up (make-array (list 1) (list 42))))
(list 1))
(list 1))
(apl-test
"enclose shape is scalar"
(sh (apl-enclose (make-array (list 3) (list 1 2 3))))
(list))
(apl-test
"enclose ravel length is 1"
(len (rv (apl-enclose (make-array (list 3) (list 1 2 3)))))
1)
(apl-test
"enclose inner ravel"
(rv (first (rv (apl-enclose (make-array (list 3) (list 1 2 3))))))
(list 1 2 3))
(apl-test
"disclose of enclose round-trips ravel"
(rv (apl-disclose (apl-enclose (make-array (list 3) (list 10 20 30)))))
(list 10 20 30))
(apl-test
"disclose of enclose round-trips shape"
(sh (apl-disclose (apl-enclose (make-array (list 3) (list 10 20 30)))))
(list 3))
(apl-test
"disclose scalar ravel"
(rv (apl-disclose (apl-scalar 42)))
(list 42))
(apl-test
"disclose vector ravel"
(rv (apl-disclose (make-array (list 3) (list 5 6 7))))
(list 5))
(apl-test
"disclose matrix returns first row"
(rv (apl-disclose (make-array (list 2 3) (list 1 2 3 4 5 6))))
(list 1 2 3))