Changeset 33360 in project


Ignore:
Timestamp:
05/29/16 07:45:59 (5 years ago)
Author:
Ivan Raikov
Message:

dyn-vector: fix for list->dynvector on empty list and added procedure dynvector (thanks to Lewis Campbell)

Location:
release/4/dyn-vector/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/4/dyn-vector/trunk/dyn-vector.scm

    r28801 r33360  
    33;; Dynamic (dense) vectors.
    44;;
    5 ;; Copyright 2007-2013 Ivan Raikov and the Okinawa Institute of Science and Technology.
     5;; Copyright 2007-2016 Ivan Raikov.
    66;;
    77;; This program is free software: you can redistribute it and/or
     
    2424 (dynvector?             
    2525  dynvector-tabulate
     26  dynvector
    2627  list->dynvector
    2728  make-dynvector
     
    6364     (make-dvbase vect dflt n))))
    6465
     66
    6567(define (list->dynvector l . rest)
    6668  (let-optionals  rest ((dflt #f))
    6769   (let* ((vect (list->vector l))
    68           (dflt (if dflt dflt (vector-ref vect 0))))
     70          (dflt (if dflt dflt #f)))
    6971     (make-dvbase vect dflt (vector-length vect)))))
     72 
     73
     74(define (dynvector . lst)
     75  (list->dynvector lst))
    7076 
    7177(define (make-dynvector n dflt)
  • release/4/dyn-vector/trunk/dyn-vector.setup

    r28802 r33360  
    1616
    1717  ; Assoc list with properties for your extension:
    18   `((version 1.12)
     18  `((version 1.13)
    1919    ))
    2020
Note: See TracChangeset for help on using the changeset viewer.