From cf7fd6d782aae3363c0b9725bcc83ebb5fcebb9d Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Sat, 16 Jul 2016 22:03:54 -0400 Subject: [PATCH] Obsolete --- lexical-scoping-test.scm | 41 ---------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 lexical-scoping-test.scm diff --git a/lexical-scoping-test.scm b/lexical-scoping-test.scm deleted file mode 100644 index c6cd61f7..00000000 --- a/lexical-scoping-test.scm +++ /dev/null @@ -1,41 +0,0 @@ -(import (scheme base) (scheme write)) - -;;; Fails when compiling compiler benchmark: -;(define (proper-length l) -; (define (length l n) -; (cond ((pair? l) (length (cdr l) (+ n 1))) ((null? l) n) (else #f))) -; (length l 0)) -; -; -;;; One possible idea, alpha conversion could maintain a local lexical environment, "locals" -;;; and use that to rename identifiers that clash with primitives. -;;; Might be able to use a list of hash tables (or alists) for this purpose. -;;; Just load up a new list when a new scope is encountered, and add any -;;; "define", "set!", or "lambda" variables to it. then if a ref is a -;;; local, we need to rename it -;;; TODO: can we use same environments as "eval" uses for this? makes -;;; sense not to reinvent things -; -;(write (proper-length '(a b c))) - - -;; Seems graphs is timing out, possibly due to too many mutations -;; in its loops. see "set!" introduced by macro expansion below: -(define size 10) -(let loop ((i 1)) - (if (< i size) - (begin (write i) (loop (+ i 1))))) - -;; Current macro expansion -(newline) - ((lambda (i) - ((lambda (loop) - (set! loop - (lambda (i) - (if (< i size) - ((lambda () (write i) (loop (+ i 1)))) - #f))) - (loop i)) - #f)) - 1) -