[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Utkarsh Singh] Undefined simultaneous definitions
From: |
Utkarsh Singh |
Subject: |
Re: [Utkarsh Singh] Undefined simultaneous definitions |
Date: |
Mon, 20 Sep 2021 18:48:44 +0530 |
On 2021-09-20, 14:07 +0200, Stefan Israelsson Tampe <stefan.itampe@gmail.com>
wrote:
Note: Now I am using Guile straight out of main branch.
> I tested your code on my machine, it works! What version of guile are you
> using?
Again I think there is a confusion. The program I have written compiles
correctly BUT the output of the program in not desirable. Here is a
test:
1. Load "ambeval.scm"
2. Type (driver-loop) into your REPL session.
3. Copy and Paste following snippet:
(define (findout32 x)
(letrec ((even?
(lambda (n)
(if (= n 0)
#t
(odd? (- n 1)))))
(odd?
(lambda (n)
(if (= n 0)
#f
(even? (- n 1))))))
(cond
((even? x) 20)
((odd? x) 30)
(else 40))))
4. Type (findout32 10)
Output/Error:
;;; Starting a new problem ERROR: In procedure scm-error:
Unassigned variable -- LOOKUP-VARIABLE-VALUE odd?
Expected Output:
20
All the best,
Utkarsh Singh
--
Utkarsh Singh
https://utkarshsingh.xyz/