Changeset 38872 in project


Ignore:
Timestamp:
08/22/20 20:08:55 (5 weeks ago)
Author:
Kon Lovett
Message:

use ! on new cons, use type variable

Location:
release/5/slib-arraymap/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • release/5/slib-arraymap/trunk/slib-arraymap.egg

    r38719 r38872  
    22;;;; Kon Lovett, Mar '20
    33
    4 ((synopsis "The SLIB applicative routines for arrays library")
    5  (version "1.1.1")
     4((synopsis "The SLIB applicative routines for the arrays library")
     5 (version "1.2.1")
    66 (author "Aubrey Jaffer")
    77 (maintainer "[[kon lovett]]")
     
    99 (license "Artistic")
    1010 (category data)
    11  (dependencies
    12   (srfi-63 "0.5") )
     11 (dependencies srfi-1 srfi-63)
    1312 (test-dependencies test)
    1413 (components
    1514  (extension slib-arraymap
    1615    (types-file)
    17     (csc-options
    18       "-O3" "-d1" "-local"
    19       "-no-procedure-checks-for-toplevel-bindings") ) ) )
     16    (csc-options "-O3" "-d1" "-strict-types" "-no-procedure-checks-for-toplevel-bindings") ) ) )
  • release/5/slib-arraymap/trunk/slib-arraymap.scm

    r38722 r38872  
    1010  array-index-for-each
    1111  array-index-map!
    12   array:copy!
     12  array-copy!
    1313  array-copy
    14   array-fold)
     14  array-fold
     15  ;
     16  array:copy!)
    1517
    1618(import scheme)
    1719(import (chicken module))
    18 (import (only (chicken base) include))
     20(import (only (chicken base) include cut))
     21(import (rename (chicken base) (sub1 1-) (add1 1+)))
    1922(import (chicken type))
     23(import (only (srfi 1) reverse!))
    2024(import (srfi 63))
    2125
     
    3640(: array-index-map! (array (#!rest -> *) -> void))
    3741(: array:copy! (array array -> void))
     42(: array-copy! (array array -> void))
    3843
    3944(: array-copy (array -> array))
    40 (: array-fold (procedure * #!rest array -> *))
     45(: array-fold (('r #!rest -> 'r) 'r #!rest array -> 'r))
    4146
    4247(include "arraymap")
     48
     49(define array-copy! array:copy!)
    4350
    4451(define (array-copy src)
     
    5158    (if (null? (cdr rdims))
    5259      (let* (
    53         (sdni (reverse (cons #f inds)))
     60        (sdni (reverse! (cons #f inds)))
    5461        (lastpair (last-pair sdni)) )
    55         (do ((i 0 (+ 1 i)))
    56             ((> i (+ -1 (car rdims))))
     62        (do ((i 0 (1+ i)))
     63            ((> i (1- (car rdims))))
    5764          (set-car! lastpair i)
    58           (set! seed (apply proc seed (map (lambda (x) (apply array-ref x sdni)) ras))) ) )
     65          (set! seed (apply proc seed (map (cut apply array-ref <> sdni) ras))) ) )
    5966      (let (
    6067        (crdims (cdr rdims))
    61         (ll (+ -1 (car rdims))) )
    62         (do ((i 0 (+ 1 i)))
     68        (ll (1- (car rdims))) )
     69        (do ((i 0 (1+ i)))
    6370            ((> i ll))
    6471          (rafo crdims (cons i inds)) ) ) ) )
  • release/5/slib-arraymap/trunk/tests/slib-arraymap-test.scm

    r38401 r38872  
    2020(test-assert "TBD array-index-for-each" array-index-for-each)
    2121(test-assert "TBD array-index-map!" array-index-map!)
    22 (test-assert "TBD array:copy!" array:copy!)
     22(test-assert "TBD array-copy!" array-copy!)
    2323
    2424(let* (
Note: See TracChangeset for help on using the changeset viewer.