From: Utkarsh Singh <utkarsh190601@gmail.com>
To: Stefan Israelsson Tampe <stefan.itampe@gmail.com>
Cc: guile-user@gnu.org
Subject: Re: [Utkarsh Singh] Undefined simultaneous definitions
Date: Mon, 20 Sep 2021 18:48:44 +0530 [thread overview]
Message-ID: <871r5jfkqz.fsf@gmail.com> (raw)
In-Reply-To: <CAGua6m33sS5NNqFE41LM6zhD7sGWimFUf0ZS8t_2=eobpRcgiQ@mail.gmail.com>
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/
next prev parent reply other threads:[~2021-09-20 13:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-20 3:15 Undefined simultaneous definitions Utkarsh Singh
2021-09-20 4:16 ` [Utkarsh Singh] " Utkarsh Singh
[not found] ` <CAGua6m39tyjgsA+PTc5+uzuOCN6O42ztQ+vibkcq7Jt98k7MYw@mail.gmail.com>
[not found] ` <878rzrfqti.fsf@gmail.com>
[not found] ` <CAGua6m33sS5NNqFE41LM6zhD7sGWimFUf0ZS8t_2=eobpRcgiQ@mail.gmail.com>
2021-09-20 13:18 ` Utkarsh Singh [this message]
2021-09-23 7:06 ` Utkarsh Singh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871r5jfkqz.fsf@gmail.com \
--to=utkarsh190601@gmail.com \
--cc=guile-user@gnu.org \
--cc=stefan.itampe@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).