[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-users] (issue) array-lib - array-copy of rank-1 array with comp
From: |
Terrence Brannon |
Subject: |
[Chicken-users] (issue) array-lib - array-copy of rank-1 array with complex elements |
Date: |
Tue, 18 Sep 2007 21:47:03 -0400 |
(require-extension array-lib)
(define (rank-1 . elems) (apply array (list (length elems)) elems))
(define a (rank-1 (make-rectangular 3 4) (make-rectangular 6 8)))
;;; http://www.call-with-current-continuation.org/eggs/array-lib.htm
;; procedure: (array-copy [PROTOTYPE] ARRAY)
;; Returns a copy of the array. When prototype is missing a deep copy is
;; performed.
(array-copy a) ;;; Error: out of range
;; When the prototype and the source array are the same,
;; (eq? PROTOTYPE ARRAY),
;; a fresh array is returned with the same shape, using the array as the
;; prototype.
(array-copy a a) ;;; drops the 2nd element of the array. actually,
I'm thinking that it
;;; might be using the first element as a prototype for the rest of
the array. But the docs
;;; say it uses the array as prototype, not the first element of it.
;; Otherwise a fresh array is returned with the specified
;; prototype and elements from the array.
(array-copy '#() a) ;;; works
- [Chicken-users] (issue) array-lib - array-copy of rank-1 array with complex elements,
Terrence Brannon <=