chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] array->list does not return a list for a rank-1 array


From: Terrence Brannon
Subject: [Chicken-users] array->list does not return a list for a rank-1 array
Date: Fri, 14 Sep 2007 16:32:12 -0400

Re: http://www.call-with-current-continuation.org/eggs/array-lib.html
Quote: procedure: (array->list ARRAY)

Returns the array elements as a rank-nested list. For rank 0 arrays returns
just the element.

== This implies

a list should be returned for rank-1 arrays

== However

For a rank-1 list consisting of 1 element, it does not return a list:

(require-extension array-lib)


(define (rank-1 . elems)
  (apply array (list (length elems)) elems))



#;90> (array-rank (rank-1 4 5))
1
#;91> (array-rank (rank-1 4))
1
#;93> (list? (array->list (rank-1 4 5)))
#t
#;94> (list? (array->list (rank-1 4 )))
#f




reply via email to

[Prev in Thread] Current Thread [Next in Thread]