unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Prafulla Giri via "Bug reports for GUILE, GNU's Ubiquitous Extension Language" <bug-guile@gnu.org>
To: 70033@debbugs.gnu.org
Subject: bug#70033: Possible Bug: Inconsistent Evaluation Environment
Date: Wed, 27 Mar 2024 15:46:41 +0000	[thread overview]
Message-ID: <K8H2FCgy3vYDCkzJRcdEHkcRmSgLXTNJfY0d3M1NWKnX9l3IGXZ7uVIooNI5VqSepmXUD6npMmSwcx81dC0Mg_U3THDTCBC3rokrbuG4wTM=@protonmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1440 bytes --]

Hello there,

I have bumped into an interesting issue with GNU Guile 3.0.9 (as shipped via GNU GUIX).

Consider a file -- file1.scm -- with the following definition over-riding the built-in procedure vector-length:

(define (vector-length whatever) "over-ridden")

Now, consider another file -- file2.scm -- which makes use of this over-ridden procedure, the contents of which are:

(load "file1.scm") ; both files are in the same directory
(define (some-procedure whatever) (vector-length whatever))

Now, if one loads file2.scm with guile with:
$ guile -l file2.scm
and in the REPL tries:
>(some-procedure 'anything) ;; this is expected to return "over-ridden"
an error is thrown saying vector-length expects a vector. To make things "curiouser and curiouser"
>(vector-length 'anything) ;; returns "over-ridden", as expected.

As such, it seems that we have a situation where the evaluation environment is somewhat inconsistent.

Interestingly enough, this problem also seems to be there on GNU Guile 2.2.7 as available via GNU Guix.

Chez Scheme 9.5.8 behaves as expected: (some-procedure 'whatever) does return "over-ridden".
Likewise with TinyScheme 1.42, Scheme48 1.9.2, MIT Scheme 11.2 and even GNU Guile 1.8.8 --- all behave as expected and return "over-ridden" after evaluating (some-procedure 'whatever).

The issue does not occur if all the definitions are in the same file, however.

Perhaps this warrants further investigation.

[-- Attachment #2: Type: text/html, Size: 5283 bytes --]

                 reply	other threads:[~2024-03-27 15:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='K8H2FCgy3vYDCkzJRcdEHkcRmSgLXTNJfY0d3M1NWKnX9l3IGXZ7uVIooNI5VqSepmXUD6npMmSwcx81dC0Mg_U3THDTCBC3rokrbuG4wTM=@protonmail.com' \
    --to=bug-guile@gnu.org \
    --cc=70033@debbugs.gnu.org \
    --cc=prafulla.giri@protonmail.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).