Add tracing for syntax

This commit is contained in:
Oliver Payne 2023-09-03 22:56:50 +01:00
parent f5ca407f3e
commit d9f84f1ca1
1 changed files with 4 additions and 3 deletions

View File

@ -1,15 +1,16 @@
#lang sicp
(#%provide (all-defined))
(#%require racket/trace)
(define (self-evaluating? exp)
(trace-define (self-evaluating? exp)
(cond ((number? exp) true)
((string? exp) true)
((eq? exp '*unassigned*) true) ; Special symbol that can
; never be a variable.
(else false)))
(define (quoted? exp)
(trace-define (quoted? exp)
(tagged-list? exp 'quote))
(define (text-of-quotation exp) (cadr exp))
@ -18,7 +19,7 @@
(eq? (car exp) tag)
false))
(define (variable? exp) (symbol? exp))
(trace-define (variable? exp) (symbol? exp))
;; Assignment
(define (assignment? exp)