Files
jak-project/test/goalc/source_templates/with_game/test-static-lambda.gc
T
water111 4bea175140 [decompiler/compiler] Fixes for task-control (#668)
* fix decompiler for task control

* support in compiler

* changelog

* typo
2021-07-01 21:38:19 -04:00

23 lines
512 B
Common Lisp

(deftype type-with-func (basic)
((add-func (function int int int))
(sub-func (function int int int))
)
)
(define *type-with-func*
(new 'static 'type-with-func
:add-func (lambda ((x int) (y int))
(+ x y))
:sub-func (lambda ((x int) (y int))
(- x y))
)
)
(defun this-is-a-function ()
"blah blah")
(format #t "Add: ~d sub: ~d~%"
((-> *type-with-func* add-func) 10 20)
((-> *type-with-func* sub-func) 10 20))