google / lisp-koans

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

Closed therik closed 10 years ago

therik commented 10 years ago

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.

lesguillemets commented 10 years ago

+1. GNU CLISP (2.49) returns #2A((5 5 NIL NIL) (5 5 NIL NIL) (NIL NIL NIL NIL)) for this.

bileschi commented 10 years ago

thx