File: raw-vector.thi

package info (click to toggle)
theme-d 7.2.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 21,036 kB
  • sloc: lisp: 9,625; sh: 5,321; makefile: 715; ansic: 477
file content (43 lines) | stat: -rw-r--r-- 1,278 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
;; -*-theme-d-*-

;; Copyright (C) 2025 Tommi Höynälänmaa
;; Distributed under GNU Lesser General Public License version 3,
;; see file doc/LGPL-3.

(define-interface (standard-library raw-vector)

  (import (standard-library core))

  (define-foreign-prim-class <raw-vector>
    (attributes equal-by-value use-eq?)
    (member-pred vector?))

  (declare-simple-method raw-vector-ref
    (<raw-vector> <integer>) <object> pure)

  (declare-simple-method raw-vector-set!
    (<raw-vector> <integer> <object>) <none> nonpure)

  (declare-simple-method raw-vector-length
    (<raw-vector>) <integer> pure)

  (declare-simple-method raw-vector
    ((rest <object>)) <raw-vector> pure)
    
  (declare-simple-method make-raw-vector
    (<integer> <object>) <raw-vector> pure)
    
  (declare-simple-method raw-vector->list
    (<raw-vector>) <list> pure)

  (declare-param-method _vector-raw-contents (%type)
    ((:vector %type)) <raw-vector> pure)

  (declare-param-method _mutable-vector-raw-contents (%type)
    ((:mutable-vector %type)) <raw-vector> pure)

  (declare _vector-with-raw-contents
    (:param-proc (%type) (<raw-vector>) (:vector %type) pure))

  (declare _mutable-vector-with-raw-contents
    (:param-proc (%type) (<raw-vector>) (:mutable-vector %type) pure)))