Common Lisp Koans is a language learning exercise in the same vein as the ruby koans, python koans and others. It is a port of the prior koans with some modifications to highlight lisp-specific features. Structured as ordered groups of broken unit tests, the project guides the learner progressively through many Common Lisp language features.
Apache License 2.0
3.13k
stars
563
forks
source link
arrays.lsp test-adjustable-array initial element #37
Hi, I'm learning through those koans now and I found small mistake:
in test-adjutable-arrays, after the (adjust-array x '(3 4)) the last assert is testing for uninitialized element. According to hyperspecs, the behavior here is undefined, thus probably SBCL specific.
The array after adjusting is: #2A((5 5 0 0) (5 5 0 0) (0 0 0 0)) in SBCL, that's somewhat counter intuitive, I'd expect NILs, not zeroes. It would be nice to put either a comment stating it's SBCL-specific when reading uninitialised element, or perhaps add :initial-element to that adjust-array.
Cheers.
Hi, I'm learning through those koans now and I found small mistake:
in test-adjutable-arrays, after the
(adjust-array x '(3 4))
the last assert is testing for uninitialized element. According to hyperspecs, the behavior here is undefined, thus probably SBCL specific. The array after adjusting is:#2A((5 5 0 0) (5 5 0 0) (0 0 0 0))
in SBCL, that's somewhat counter intuitive, I'd expectNIL
s, not zeroes. It would be nice to put either a comment stating it's SBCL-specific when reading uninitialised element, or perhaps add:initial-element
to thatadjust-array
. Cheers.