Previous: Live Reloading, Up: Utilities [Contents][Index]
(use-modules (sly utils))
Miscellaneous helpful procedures.
Define a new guardian called name
and call reaper
when
an object within the guardian is GC’d. Reaping is ensured to happen
from the same thread that is running the game loop.
Return a memoizing version of proc
.
Evaluate body
in an unbounded loop. Useful in coroutines that
have no end.
Create a new procedure that applies the procedure bound to
proc-name
with all given arguments.
Handy macro for flattening nested procedure calls where the output of an inner call is the last argument to the outer call.
(chain* (list '(1 2) '(3 4)) (map +) (fold + 0)) ;; => 10
Like chain*
but for a single argument.
(chain '(1 2 3 4) (map 1+) (fold + 0)) ;; => 14
Convert lst
and all sub-lists within to vlists.
Return the element at index index …
in the nested vlist
structure vlist
.