~ubuntu-branches/ubuntu/trusty/mit-scheme/trusty-proposed

« back to all changes in this revision

Viewing changes to src/runtime/vector.scm

  • Committer: Bazaar Package Importer
  • Author(s): Evan Broder
  • Date: 2009-03-08 00:46:17 UTC
  • mfrom: (1.1.6 upstream) (3.1.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090308004617-csqyjpnkg7daq9c4
Tags: 7.7.90+20090107-1ubuntu1
* Merge from debian unstable, remaining changes (LP: #288000, #217792):
  * Bootstrapping done via binary package from Debian unstable. See log
      entry for 7.7.90+20060906-3ubuntu1 for details.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#| -*-Scheme-*-
2
2
 
3
 
$Id: vector.scm,v 14.27 2007/01/05 21:19:28 cph Exp $
 
3
$Id: vector.scm,v 14.29 2008/02/10 06:14:19 cph Exp $
4
4
 
5
5
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
6
6
    1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
7
 
    2006, 2007 Massachusetts Institute of Technology
 
7
    2006, 2007, 2008 Massachusetts Institute of Technology
8
8
 
9
9
This file is part of MIT/GNU Scheme.
10
10
 
30
30
 
31
31
(declare (usual-integrations))
32
32
 
33
 
(define-primitives
34
 
  vector? vector-length vector-ref vector-set!
35
 
  list->vector vector subvector->list
36
 
  subvector-move-right! subvector-move-left! subvector-fill!)
 
33
(define-integrable vector
 
34
  (ucode-primitive vector))
 
35
 
 
36
(define-integrable (vector? object)
 
37
  ((ucode-primitive vector?) object))
 
38
 
 
39
(define-integrable (vector-length v)
 
40
  ((ucode-primitive vector-length) v))
 
41
 
 
42
(define-integrable (vector-ref v i)
 
43
  ((ucode-primitive vector-ref) v i))
 
44
 
 
45
(define-integrable (vector-set! v i x)
 
46
  ((ucode-primitive vector-set!) v i x))
 
47
 
 
48
(define-integrable (list->vector list)
 
49
  ((ucode-primitive list->vector) list))
 
50
 
 
51
(define-integrable (subvector->list v s e)
 
52
  ((ucode-primitive subvector->list) v s e))
 
53
 
 
54
(define-integrable (subvector-fill! v s e x)
 
55
  ((ucode-primitive subvector-fill!) v s e x))
 
56
 
 
57
(define-integrable (subvector-move-left! v1 s1 e1 v2 s2)
 
58
  ((ucode-primitive subvector-move-left!) v1 s1 e1 v2 s2))
 
59
 
 
60
(define-integrable (subvector-move-right! v1 s1 e1 v2 s2)
 
61
  ((ucode-primitive subvector-move-right!) v1 s1 e1 v2 s2))
37
62
 
38
63
(define-integrable (guarantee-vector object procedure)
39
64
  (if (not (vector? object))