Changeset 14383 in project


Ignore:
Timestamp:
04/23/09 04:11:02 (11 years ago)
Author:
Ivan Raikov
Message:

sparse-vectors ported to Chicken 4

Location:
release/4/sparse-vectors
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/4/sparse-vectors/sparse-vectors.scm

    r4706 r14383  
    1111
    1212
    13 (declare
    14   (export make-sparse-vector
    15           sparse-vector?
    16           sparse-vector-ref
    17           sparse-vector-set!
    18           sparse-vector->list) )
     13(module sparse-vectors
     14
     15        (make-sparse-vector
     16         sparse-vector?
     17         sparse-vector-ref
     18         sparse-vector-set!
     19         sparse-vector->list)
     20                   
     21  (import scheme chicken data-structures extras )
     22
    1923
    2024(define hilbert-log 8)
     
    112116                               (- height 1) more)))
    113117            ((< i 0) more)))))
     118)
  • release/4/sparse-vectors/sparse-vectors.setup

    r4706 r14383  
     1;;;; -*- Hen -*-
    12
    2 (define has-exports? (string>=? (chicken-version) "2.310"))
     3(define (dynld-name fn)         
     4  (make-pathname #f fn ##sys#load-dynamic-extension))   
    35
    4 (compile -s
    5          ,@(if has-exports? '(-check-imports -emit-exports sparse-vectors.exports) '())
    6          sparse-vectors.scm -d2)
     6(compile -O2 -d0 -s sparse-vectors.scm -j sparse-vectors)
     7(compile -O2 -d0 -s sparse-vectors.import.scm)
    78
    89(when (extension-information 'numbers)
    9   (compile -s sparse-vectors.scm
    10            ,@(if has-exports? '(-check-imports -emit-exports sparse-vectors.exports) '())
    11            -R numbers -O2 -d1 -o big-sparse-vectors.so) )
     10      (begin
     11        (compile -O2 -d0 -require-extension datatype
     12                 -s sparse-vectors.scm -o ,(dynld-name "big-sparse-vectors") -j big-sparse-vectors)
     13        (compile -O2 -d0  -s big-sparse-vectors.import.scm)))
    1214
    1315(install-extension
    14  'sparse-vectors
    15  `("sparse-vectors.so"
    16    ,@(if has-exports? '("sparse-vectors.exports") (list))
    17    ,@(if (extension-information 'numbers)
    18          '("big-sparse-vectors.so")
    19          '() ) )
    20  '((version 0.2)
    21    (documentation "sparse-vectors.html")
    22    ,@(if has-exports? `((exports "sparse-vectors.exports")) (list)) ))
    2316
     17  ; Name of your extension:
     18  'sparse-vectors
     19
     20  ; Files to install for your extension:
     21  `(,(dynld-name "sparse-vectors") ,(dynld-name "sparse-vectors.import")
     22    ,@(if (extension-information 'numbers)
     23          `(,(dynld-name "big-sparse-vectors") ,(dynld-name "big-sparse-vectors.import") ) '())
     24    )
     25
     26  ; Assoc list with properties for your extension:
     27  `((version 0.3)
     28    (documentation "sparse-vectors.html")
     29    ))
Note: See TracChangeset for help on using the changeset viewer.