Subject: [3.0.0] At -O2, top-level definitions not evaluated in order?
From: Ludovic Courtès <[email-masked]>
To: [email-masked]
Date: Thu, 23 Jan 2020 10:51:20 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello!

Guile-Lib’s md5.scm does something like:

--8<---------------cut here---------------start------------->8---
(define f-ash ash)

(define (ash x n)
  (modulo (f-ash x n) #x100000000))
--8<---------------cut here---------------end--------------->8---

At -O0 and -O1, this has the desired effect: ‘f-ash’ is an alias for
(@ (guile) ash).

However, at -O2 and above, ‘f-ash’ is eq? to the ‘ash’ defined right
below it.

This seems to contradict R5RS (info "(r5rs) Top level definitions").

Thoughts?

Ludo’.