29 lines
604 B
Scheme
29 lines
604 B
Scheme
(include stdlib.h)
|
|
(include stddef.h)
|
|
(include stdbool.h)
|
|
(include stdio.h)
|
|
|
|
(load "list.hsex")
|
|
|
|
(struct foo
|
|
((float a)
|
|
(int b)))
|
|
|
|
,(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)
|
|
|
|
(fn bool bar () false)
|
|
|
|
(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)
|