guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A weird problem about "define-private', need help please!


From: K.L.
Subject: Re: A weird problem about "define-private', need help please!
Date: Sun, 18 Oct 2020 13:12:35 +0800

Never mind, I figured it out. The actual problem is I didn't get the correct error message.

On Sat, Oct 17, 2020 at 2:12 PM K.L. <k.l.lambda@gmail.com> wrote:
Hello guys.

I built myself a libguile.so with guile-1.8.8 source code. When running, I got the error:
Unbound variable: define-private

According to my debug tracing, the initialization of scm_init_guile has been executed safely. And I'm sure that boot-9.scm has been loaded. The error occurred at a user scm file:

(define-public (randomize-rand-seed)
(ly:randomize-rand-seed)
(let*
((t (gettimeofday))
(seed (*
(cdr t)
(car t)
(getpid))))
(set! *random-state* (seed->random-state seed))))


I saw that the C function getpid has been called, then the error was thrown.

And I noticed that the define-private was referenced only once in boot-9.scm around all guile-1.8.8 assets:
(define define-private define)

(defmacro define-public args
(define (syntax)
(error "bad syntax" (list 'define-public args)))
(define (defined-name n)
(cond
((symbol? n) n)
((pair? n) (defined-name (car n)))
(else (syntax))))
(cond
((null? args)
(syntax))
(#t
(let ((name (defined-name (car args))))
`(begin
(define-private ,@args)
(eval-case ((load-toplevel) (export ,name))))))))


I tried to replace 'define-private' by 'define', and I got an error of 'Unbound variable: define'. I'm new in language Scheme and GUILE, I have no idea what happened.

I adjusted some C building config options to adapt the Android NDK build environment. That seems not related to this problem, but I'm not sure. Here is my config.h.

Thanks for any help.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]