unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* A weird problem about "define-private', need help please!
@ 2020-10-17  6:12 K.L.
  2020-10-18  5:12 ` K.L.
  0 siblings, 1 reply; 4+ messages in thread
From: K.L. @ 2020-10-17  6:12 UTC (permalink / raw)
  To: guile-devel

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

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
<https://gitlab.com/k.l.lambda/lilypond/-/blob/dev/kl/android-port/node-addon/android/third-party/libs/guile/x86/config.h>
.

Thanks for any help.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: A weird problem about "define-private', need help please!
  2020-10-17  6:12 A weird problem about "define-private', need help please! K.L.
@ 2020-10-18  5:12 ` K.L.
  2020-10-18  6:32   ` Thien-Thi Nguyen
  0 siblings, 1 reply; 4+ messages in thread
From: K.L. @ 2020-10-18  5:12 UTC (permalink / raw)
  To: guile-devel

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

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
> <https://gitlab.com/k.l.lambda/lilypond/-/blob/dev/kl/android-port/node-addon/android/third-party/libs/guile/x86/config.h>
> .
>
> Thanks for any help.
>

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: A weird problem about "define-private', need help please!
  2020-10-18  5:12 ` K.L.
@ 2020-10-18  6:32   ` Thien-Thi Nguyen
  2020-10-18  9:04     ` K.L.
  0 siblings, 1 reply; 4+ messages in thread
From: Thien-Thi Nguyen @ 2020-10-18  6:32 UTC (permalink / raw)
  To: K.L.; +Cc: guile-devel

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

() "K.L." <k.l.lambda@gmail.com>
() 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.

What is the correct error message?

-- 
Thien-Thi Nguyen -----------------------------------------------
 (defun responsep (query)               ; (2020) Software Libero
   (pcase (context query)               ;       = Dissenso Etico
     (`(technical ,ml) (correctp ml))
     ...))                              748E A0E8 1CB8 A748 9BFA
--------------------------------------- 6CE4 6703 2224 4C80 7502

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 219 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: A weird problem about "define-private', need help please!
  2020-10-18  6:32   ` Thien-Thi Nguyen
@ 2020-10-18  9:04     ` K.L.
  0 siblings, 0 replies; 4+ messages in thread
From: K.L. @ 2020-10-18  9:04 UTC (permalink / raw)
  To: Thien-Thi Nguyen; +Cc: guile-devel

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

My first running environment didn't print guile errors (I still don't know
why). I deduce the message by break point, and stack data. I saw 'Unbound
variable: ~S' and the first scm object in args was translated as
'define-private'.

Then today I setup a PC environment with the same config.h, and test again.
I saw the real error is '(define-private _ gettext)' and 'Unbound variable:
gettext'.

The project is supposed to handle guile error at high-level code, but it
failed handling for some unknown reason. So it takes some extra time to
work it out. However, after the error thrown the guile thread just quit
(printing nothing) and left a silent running process, it's wired.

On Sun, Oct 18, 2020 at 2:35 PM Thien-Thi Nguyen <ttn@gnuvola.org> wrote:

> () "K.L." <k.l.lambda@gmail.com>
> () 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.
>
> What is the correct error message?
>
> --
> Thien-Thi Nguyen -----------------------------------------------
>  (defun responsep (query)               ; (2020) Software Libero
>    (pcase (context query)               ;       = Dissenso Etico
>      (`(technical ,ml) (correctp ml))
>      ...))                              748E A0E8 1CB8 A748 9BFA
> --------------------------------------- 6CE4 6703 2224 4C80 7502
>

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-10-18  9:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-17  6:12 A weird problem about "define-private', need help please! K.L.
2020-10-18  5:12 ` K.L.
2020-10-18  6:32   ` Thien-Thi Nguyen
2020-10-18  9:04     ` K.L.

unofficial mirror of guile-devel@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/guile-devel/0 guile-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 guile-devel guile-devel/ https://yhetil.org/guile-devel \
		guile-devel@gnu.org
	public-inbox-index guile-devel

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.lisp.guile.devel
	nntp://news.gmane.io/gmane.lisp.guile.devel


AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git