"unbound identifier" errors in scheme
Posted
by user186909
on Stack Overflow
See other posts from Stack Overflow
or by user186909
Published on 2010-04-29T01:41:12Z
Indexed on
2010/04/29
1:47 UTC
Read the original article
Hit count: 1074
Hello:
I'm using drscheme from: http://www.archlinux.org/packages/extra/x86_64/drscheme/
I'm trying to work with the sample code in my textbook, but I keep getting getting "unbound identifier" errors. Is it because the scheme interpreter is not configured correctly? or is the code just plain wrong?
Here are a few examples:
Input:
#lang scheme
(define (equalimp lis1 lis2)
(COND
((NULL? lis1) (NULL? lis2))
((NULL? lis2) '())
((EQ? (CAR lis1) (CAR lis2)) (equalimp (CDR lis1) (CDR lis2)))
(ELSE '())
))
Output:
Welcome to DrScheme, version 4.2.5 [3m]. Language: scheme; memory limit: 128 MB.
expand: unbound identifier in module in: COND
Input:
#lang scheme
(define (quadratic_roots a b c)
(LET (
(root_part_over_2a
(/ (SQRT (- (* b b) (* 4 a c))) (* 2 a)))
(minus_b_over_2a (/ (- 0 b) (* 2 a)))
)
(DISPLAY (+ minus_b_over_2a root_part_over_2a))
(NEWLINE)
(DISPLAY (- minus_b_over_2a root_part_over_2a))
))
Output:
expand: unbound identifier in module in: LET
Note: I tried using LET* because I read this: stackoverflow.com/ questions/946050/using-let-in-scheme but it produces the same error.
Thanks !
© Stack Overflow or respective owner