From 9593f27df88211b610799a1c09105f23ea311ffb Mon Sep 17 00:00:00 2001 From: JJ Date: Thu, 20 Jun 2024 13:38:21 -0700 Subject: go all in on unicode: rename ctx and heap to \Gamma and \Sigma --- stlc-rec.rkt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'stlc-rec.rkt') diff --git a/stlc-rec.rkt b/stlc-rec.rkt index 24bbb8f..97ee9a3 100644 --- a/stlc-rec.rkt +++ b/stlc-rec.rkt @@ -12,22 +12,22 @@ ; Γ ⊢ unfold [μx.t] e: [x ↦ μx.t] t ;; (interpret Expr Table[Sym, Expr]): Value -(define (interpret expr [ctx #hash()]) - (interpret- (strip (desugar expr)) ctx)) -(define (interpret- expr ctx) +(define (interpret expr [Γ #hash()]) + (interpret- (strip (desugar expr)) Γ)) +(define (interpret- expr Γ) (match expr ['sole 'sole] [n #:when (natural? n) n] - [x #:when (dict-has-key? ctx x) (dict-ref ctx x)] + [x #:when (dict-has-key? Γ x) (dict-ref Γ x)] [`(fold ,t ,e) `(fold ,t ,(interpret- e))] [`(unfold ,t ,e) `(unfold ,t ,(interpret- e))] - [`(λ ,x ,e) `(λ ,x ,e ,ctx)] + [`(λ ,x ,e) `(λ ,x ,e ,Γ)] [`(,e1 ,e2) - (match (interpret- e1 ctx) + (match (interpret- e1 Γ) [`(λ ,x ,e ,env) - (interpret- e (dict-set env x (interpret- e2 ctx)))] + (interpret- e (dict-set env x (interpret- e2 Γ)))] [e (err (format "applying arg ~a to unknown expression ~a" e2 e))])] [e (err (format "interpreting an unknown expression ~a" e))])) -- cgit v1.2.3-70-g09d2