forked from coalton-lang/coalton
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbits.lisp
38 lines (32 loc) · 780 Bytes
/
bits.lisp
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
(coalton-library/utils::defstdlib-package #:coalton-library/bits
(:shadow
#:and
#:or
#:xor
#:not)
(:use
#:coalton)
(:import-from
#:coalton-library/classes
#:Num)
(:export
#:Bits
#:and
#:or
#:xor
#:not
#:shift))
(in-package #:coalton-library/bits)
(named-readtables:in-readtable coalton:coalton)
#+coalton-release
(cl:declaim #.coalton-impl/settings:*coalton-optimize-library*)
(coalton-toplevel
(define-class (Num :int => Bits :int)
"Operations on the bits of twos-complement integers"
(and (:int -> :int -> :int))
(or (:int -> :int -> :int))
(xor (:int -> :int -> :int))
(not (:int -> :int))
(shift (Integer -> :int -> :int))))
#+sb-package-locks
(sb-ext:lock-package "COALTON-LIBRARY/BITS")