From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "K.L." Newsgroups: gmane.lisp.guile.devel Subject: A weird problem about "define-private', need help please! Date: Sat, 17 Oct 2020 14:12:26 +0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000008d17ef05b1d7c4ff" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14867"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Sat Oct 17 16:56:05 2020 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kTncq-0003fB-FI for guile-devel@m.gmane-mx.org; Sat, 17 Oct 2020 16:56:04 +0200 Original-Received: from localhost ([::1]:46306 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kTncp-00082f-IK for guile-devel@m.gmane-mx.org; Sat, 17 Oct 2020 10:56:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56650) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kTfSK-0004pU-LW for guile-devel@gnu.org; Sat, 17 Oct 2020 02:12:40 -0400 Original-Received: from mail-vs1-xe2f.google.com ([2607:f8b0:4864:20::e2f]:46127) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kTfSI-0000EO-H4 for guile-devel@gnu.org; Sat, 17 Oct 2020 02:12:40 -0400 Original-Received: by mail-vs1-xe2f.google.com with SMTP id d4so2665533vsk.13 for ; Fri, 16 Oct 2020 23:12:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=7mu5beP+Dfbse2Z/l3RoDrY2SWzbnaQFJvmas0Rmk7c=; b=P1qjF1LJ+RjQpUN5g69yyHOem8YDlXfhAHoJGz9gSwfQFdMocW3N1eeTs2fNlADhJA UdrGk6sFfeSogWCGFRhZeMATLAT13HNNZr1KdxB3MgMKQLOthvLftuMdi6GUOlHJVehU XXO+EPmeq9qOgzQzGMRnDeu5nGRXL2E1349M2UCtkbvvxSGxWtBTzBqRttDbwAXsIEoa EkJ2A/8kzt2rkKdoZh/c374+92B/gQhXVyx8KftbZY31AJN8Gy5FSZoBxbVc06/sZm7f 4LzwXEY0FTTPsvWICl9Jy/l3a8YWjBmWVMNnNQYk54NMKaLOAE3QMhD0/4CZFvJi/aMx +y/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=7mu5beP+Dfbse2Z/l3RoDrY2SWzbnaQFJvmas0Rmk7c=; b=JLr7qfhHXROC4fpf877zjsFLxb/RrcqiAkY4NtmGBYyK/Bw8BlH2fkF553ysTz4OYB U0yzxCOtkozGl6iq4l/7jjEpQ8wEVGKaTXlAgnVq8rokhvgMyT733HpVT3NHp3Ei5Jh4 2yBqTctmmAuWX2kho99Kk57KhUr2onBdJBMZfx+E2bSAUHToFsZTDUhPBOvkmF9/4zmy UnSJRHkizKtXUlYi26e5NyQ5nHuzdINJJaB6aKflRtGNAw1JdhcPLDY3xS1MC68/EDgY E7URMP9rPPrBWq10mD3NW1fvP3yUK5KxIl4J6RCUvsdgme0ZlVVQGoJyi5rH7gmv5yLA dfcg== X-Gm-Message-State: AOAM531ZUy1Gi3DYEd0z227PsAidnUzosN7Ci8y7BCmqwIcUefb2zFh6 OLelp/rduC9v/ht9wsMDCo1nCG/FY6R/yAYxmKX1WegjHsA= X-Google-Smtp-Source: ABdhPJzP4R9vuPBJbkiBZqlGKKe/tj74prZSb1dFGr2VO9NXfFlCJvWQ98/+fExeJrS1AV4JC5dDWpVxY+Oz5N5PHD0= X-Received: by 2002:a05:6102:208e:: with SMTP id h14mr4508816vsr.42.1602915157218; Fri, 16 Oct 2020 23:12:37 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::e2f; envelope-from=xxxk.l.xxx@gmail.com; helo=mail-vs1-xe2f.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 17 Oct 2020 10:55:39 -0400 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.io gmane.lisp.guile.devel:20595 Archived-At: --0000000000008d17ef05b1d7c4ff Content-Type: text/plain; charset="UTF-8" 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. --0000000000008d17ef05b1d7c4ff Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello guys.

I built myself a l= ibguile.so with guile-1.8.8 source code. When running, I got the error:=
Unbound variable: de= fine-private

According to my debug tracing,= the initialization of=C2=A0scm_init_guile has been executed safely.= And I'm sure that=C2=A0boot-9.scm has been loaded. The error oc= curred=C2=A0at a user scm file:

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

I saw that the C=C2=A0function=C2= =A0getpid=C2=A0has been called, then the error was thrown.

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

(defmacro define-public args
(define (syntax)
(error "ba= d syntax" (list &= #39;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 'U= nbound variable: define'. I'm new in language Scheme and GUILE, I h= ave no idea what happened.

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

Thanks for any help.
--0000000000008d17ef05b1d7c4ff--