diff options
-rw-r--r-- | chickadee/graphics/seagull.scm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/chickadee/graphics/seagull.scm b/chickadee/graphics/seagull.scm index d03de86..abd4429 100644 --- a/chickadee/graphics/seagull.scm +++ b/chickadee/graphics/seagull.scm @@ -142,8 +142,12 @@ (make-exception-with-message "seagull: unbound variable") (make-exception-with-irritants (list name (env-names env))))))) -(define (lookup* name env) - (assq-ref env name)) +(define* (lookup* name env #:optional default) + (let loop ((env env)) + (match env + (() default) + (((k . v) . rest) + (if (eq? k name) v (loop rest)))))) (define (lookup-all names env) (map (lambda (name) (lookup name env)) names)) |