47 lines
1.1 KiB
Scheme
47 lines
1.1 KiB
Scheme
(include stdlib.h)
|
|
(include stddef.h)
|
|
(include stdbool.h)
|
|
(include stdio.h)
|
|
|
|
(chicken-import srfi-1 brev-separate) ; list routines, e.g. fold
|
|
|
|
(chicken-load "list.seh")
|
|
|
|
(define (imports-test a b c)
|
|
(fold + 0 (list 1 2 3 a b c)))
|
|
|
|
(struct foo
|
|
((float a)
|
|
(int b)
|
|
((const char *) c)
|
|
((fn bool ((bool val))) not)))
|
|
|
|
,(list-T '(int))
|
|
,(make-list-T '(int) #f)
|
|
,(add-value-list-T '(int) #f)
|
|
,(length-list-T '(int) #f)
|
|
,(is-empty-list-T '(int) #f)
|
|
|
|
(extern fn void puk ((int a) (float b)))
|
|
(fn int bar () ,(imports-test 10 20 30))
|
|
(pub fn void baz () true)
|
|
|
|
(extern var int i)
|
|
(var int j)
|
|
(pub var int k)
|
|
|
|
(pub fn int main ()
|
|
(var (* list-int) l (make-list-int))
|
|
(printf "Size of the list: %zu\n" (length-list-int l))
|
|
(add-value-list-int l 3)
|
|
(add-value-list-int l 4)
|
|
(printf "Size of the list: %zu\n" (length-list-int l))
|
|
,(list-for-each '((printf "%d " v) l v))
|
|
(printf "\n")
|
|
0)
|
|
|
|
(pub fn segs-renderer* create-renderer ())
|
|
(pub fn void clear-command-buffer ((segs-renderer *r)))
|
|
(pub fn void add-render-command ((segs-renderer *r) ((fn void ()) command)))
|
|
(pub fn void commit-command-buffer ((segs-renderer *r)))
|