;; ------------------------------------------------------------------------ ;; | FILE : lexical-address.rkt | ;; | AUTHOR : Eugene Wallingford | ;; | CREATION DATE : 2024/03/28 | ;; | DESCRIPTION : The function lexical-address takes as input an | ;; | expression in a little language consisting of | ;; | variable references, variable-arity functions, | ;; | function applications, and if expressions. | ;; | lexical-address returns an equivalent expression | ;; | in which all variable references are replaced | ;; | with their lexical addresses, in the form | ;; | (var : depth position). | ;; ------------------------------------------------------------------------ #lang racket (require "syntax-procs.rkt") (require "free-vars.rkt") (require "list-index.rkt") (provide lexical-address) ;; ------------------------------------------------------------------------ ;; ------------------------------------------------------------------------ (define lexical-address (lambda (exp) (error 'lexical-address "unknown exp ~a" exp))) ;; ------------------------------------------------------------------------ ;; ----- END OF FILE ------------------------------------------------------