on guile 3.0.11, something is broken when integer?, throw, and floor or ceiling are used together. just see my experiment below, you can try the commands if you have guix installed for a clean guile 3.0.11 environment.
I really could not figure out why the combination breaks something inferior.
In short, executing `(lambda (x) (unless (integer? x) (throw 'bad)) (floor x))` with guile 3.0.11 would fail, which is not mentioned by the documentation, so it is a bug instead of feature.


```
$ guix time-machine --commit=2d4d9f167f75f45e3d86b62f8309bb4ce7f145e2 -- shell -C guile -- guile --no-auto-compile
GNU Guile 3.0.11
Copyright (C) 1995-2024 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guile-user)> (lambda (x) (unless (integer? x) (throw 'bad)))
$1 = #<procedure 13e28840 at <unknown port>:1:0 (x)>
scheme@(guile-user)> (lambda (x) (unless (integer? x) (throw 'bad)) (round x))
$2 = #<procedure 13e2a390 at <unknown port>:2:0 (x)>
scheme@(guile-user)> (lambda (x) (unless (integer? x) (throw 'bad)) (truncate x))
$3 = #<procedure 13e2b418 at <unknown port>:3:0 (x)>
scheme@(guile-user)> (lambda (x) (unless (integer? x) (throw 'bad)) (floor x))
While compiling expression:
In procedure =: Wrong type argument in position 1: #<unspecified>
scheme@(guile-user)> (lambda (x) (unless (integer? x) (throw 'bad)) (ceiling x))
While compiling expression:
In procedure =: Wrong type argument in position 1: #<unspecified>
scheme@(guile-user)> (lambda (x) (unless (integer? x) 1) (floor x))
$4 = #<procedure 13e2c118 at <unknown port>:6:0 (x)>
scheme@(guile-user)> (lambda (x) (unless (number? x) (throw 'bad)) (floor x))
$5 = #<procedure 13e2ca88 at <unknown port>:7:0 (x)>
scheme@(guile-user)>
```

--
fingerprint: 469A 1322 13E3 4A61 24DC 8001 8D4B C9CD 361B 6C8C

Attachment: OpenPGP_0x8D4BC9CD361B6C8C.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

  • bug#82219: floo... Bug reports for GUILE, GNU's Ubiquitous Extension Language

Reply via email to