define inside define-public throws some error with guile 3
Hello,
I am following your guide and this code does not work for me: https://jeko.frama.io/en/chars.html#Refactor
(define-module (characters))
(define-public (letter-belongs? char interval)
"Return true if char belongs to interval, else return false"
(define (preceed-lower-bound? letter)
(char<=? letter (car interval)))
(define (follow-upper-bound? letter)
(char>=? letter (cdr interval))))
(and (preceed-lower-bound? letter)
(follow-upper-bound? letter))
When I run: guile --no-auto-compile -L . characters-test.scm
I get
ice-9/psyntax.scm:2824:12: In procedure syntax-violation:
Syntax error:
characters.scm:3:0: body should end with an expression in form (lambda (char interval) "Return true if char belongs to interval, else return false" (define (preceed-lower-bound? letter) (char<=? letter (car interval))) (define (follow-upper-bound? letter) (char>=? letter (cdr interval))))
$ guile --version
guile (GNU Guile) 3.0.9
Copyright (C) 2023 Free Software Foundation, Inc.
License LGPLv3+: GNU LGPL 3 or later <http://gnu.org/licenses/lgpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Edited by Eugen Stan