mirror of
https://github.com/open-goal/jak-project
synced 2026-07-01 20:20:35 -04:00
cadd014add
* first part of static inline array fields * level h
47 lines
1.4 KiB
Common Lisp
47 lines
1.4 KiB
Common Lisp
(deftype test-basic-for-static-inline (basic)
|
|
((value uint32)
|
|
(name string)
|
|
(thing symbol)
|
|
(lst pair)
|
|
)
|
|
)
|
|
|
|
(let ((test-arr (new 'static 'inline-array test-basic-for-static-inline 3
|
|
(new 'static 'test-basic-for-static-inline :value 12 :name "test-name" :thing 'beans :lst '("asdf" b ( c . d)))
|
|
(new 'static 'test-basic-for-static-inline :value 1235 :name "hello")
|
|
)
|
|
)
|
|
)
|
|
(format #t "~A ~A #x~X #x~X ~A~%"
|
|
(-> test-arr 0 type)
|
|
(-> test-arr 1 type)
|
|
(logand 15 (the int (-> test-arr 1)))
|
|
(logand 15 (the int test-arr))
|
|
(-> test-arr 1 name)
|
|
)
|
|
|
|
)
|
|
|
|
(deftype test-struct-for-static-inline (structure)
|
|
((value uint32)
|
|
(name string)
|
|
(thing symbol)
|
|
(lst pair)
|
|
)
|
|
)
|
|
|
|
(let ((test-arr (new 'static 'inline-array test-struct-for-static-inline 3
|
|
(new 'static 'test-struct-for-static-inline :value 12 :name "test-name" :thing 'beans :lst '("asdf" b ( c . d)))
|
|
(new 'static 'test-struct-for-static-inline :value 1235 :name "hello")
|
|
)
|
|
)
|
|
)
|
|
(format #t "#x~X #x~X ~A~%"
|
|
;;(-> test-arr 0 type)
|
|
;;(-> test-arr 1 type)
|
|
(logand 15 (the int (-> test-arr 1)))
|
|
(logand 15 (the int test-arr))
|
|
(-> test-arr 1 name)
|
|
)
|
|
|
|
) |