racket - how to make predicates function? in scheme -
I am trying to take action on future
Datatype definition
(define-datatype expression expression? (Num number?)) (Var-exp (var symbol?)) (Zero? -exp (exp1 expression?)) (Diff-exp (exp1 expression?) (Exp2 expression?))) If the argument is # 2 (straight: const-exp 7) then print #t
if argument # 2 (struct: var - Exp x) Then print # f
(const-exp define? ...) If you help me, then this is respect
So my guess is that you are reading and probably use it as your environment .
If this is true, you should probably use it here:
(define-const-exp? E) (case expression (const-exp ( num) #t) (else #f)) then
& gt; (Cost-exp? (Constant-Express 7)) # T & gt; (Consta-exp? (Vir XAP 'X)) #F
Comments
Post a Comment