Skip to content

Instantly share code, notes, and snippets.

@prasad83
Created December 1, 2023 08:44
Show Gist options
  • Save prasad83/196d59d6d66bb2a47f6eaabe1ae27f58 to your computer and use it in GitHub Desktop.
Save prasad83/196d59d6d66bb2a47f6eaabe1ae27f58 to your computer and use it in GitHub Desktop.
LISP - flet* implementation
; clisp provides (let and let*) combos however has only (flet).
; Using macro we can define flet* as below
(defmacro flet* (&rest body)
`(labels ,@body))
; example
; (print (flet* ((five-times (n) (* n 5))
; (ten-times (n) (* (five-times n) 2)))
; (ten-times (b 10)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment