From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: on second/.go-cached run: ERROR: Unbound variable: for-each - simplified Date: Mon, 23 May 2011 23:02:44 +0200 Message-ID: References: <1296764433.19670.282.camel@vuurvlieg> <1298462070.10074.358.camel@vuurvlieg> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1306184601 12681 80.91.229.12 (23 May 2011 21:03:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 23 May 2011 21:03:21 +0000 (UTC) Cc: guile-devel To: Jan Nieuwenhuizen Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon May 23 23:03:12 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QOcHQ-0002me-06 for guile-devel@m.gmane.org; Mon, 23 May 2011 23:03:12 +0200 Original-Received: from localhost ([::1]:34036 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOcHP-0006yO-Hq for guile-devel@m.gmane.org; Mon, 23 May 2011 17:03:11 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:39321) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOcHE-0006tf-Re for guile-devel@gnu.org; Mon, 23 May 2011 17:03:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QOcH5-0005BP-2B for guile-devel@gnu.org; Mon, 23 May 2011 17:03:00 -0400 Original-Received: from a-pb-sasl-sd.pobox.com ([64.74.157.62]:43578 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOcH4-0005BK-UK for guile-devel@gnu.org; Mon, 23 May 2011 17:02:51 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 7B0875B7C; Mon, 23 May 2011 17:04:58 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=kHP+4LkOMsPCE1aymkl20sfsXbo=; b=fy+1Vq BwLrS1NgNOSoxvuCfEgOj/uErNnFZ6qzgMV0TbeZIHIdADgEC+AA7+a8HumvrtfE BnmZTlRjuWdPH4JxYAbofU/EPQnEKQR2FWmzkD8NfZqdhAskPaXJSyDrhCwgOvuA JozbdYWhAdX4f/O/y1OUGCqHFThMMdAWx/7L0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=kO9+kGsQOjlUK/pL+FvyXJhJ+zQ6LZoj O69seq6beR4HhJEfrusOTgJ2Mwo5zMjjIgoPbkuNsFAuZ6ZwaxcppaCSYl/pfBce eNxG+cBTxEwYy+SrcmloJ2ft6DcekQX66YJSelGq9xqmLk7dw/x8H5926wMaWccZ dGqhvtuT1kc= Original-Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 663BE5B7A; Mon, 23 May 2011 17:04:57 -0400 (EDT) Original-Received: from unquote.localdomain (unknown [90.164.198.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id 9706F5B79; Mon, 23 May 2011 17:04:55 -0400 (EDT) In-Reply-To: <1298462070.10074.358.camel@vuurvlieg> (Jan Nieuwenhuizen's message of "Wed, 23 Feb 2011 12:54:30 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: 50750868-8580-11E0-A069-D6B6226F3D4C-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 64.74.157.62 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:12528 Archived-At: Hi Janneke, On Wed 23 Feb 2011 12:54, Jan Nieuwenhuizen writes: > This morning I've spend some time to reduce this problem into > a single scheme file, see attached. > > Again, here's what happens when I run it twice, starting from > a clean cache. > > First run > > 12:47:07 janneke@vuurvlieg:~/vc/schikkers-list > $ rm -rf ~/.cache/guile > 12:47:10 janneke@vuurvlieg:~/vc/schikkers-list > $ ./compile-cache-run-problem.scm > ;;; note: autocompilation is enabled, set GUILE_AUTO_COMPILE=0 > ;;; or pass the --no-autocompile argument to disable. > ;;; compiling ./compile-cache-run-problem.scm > ;;; compiled /home/janneke/.cache/guile/ccache/2.0-0.T-LE-4/home/janneke/vc/schikkers-list/compile-cache-run-problem.scm.go > HALLO > 12:47:16 janneke@vuurvlieg:~/vc/schikkers-list > > Second run > > $ ./compile-cache-run-problem.scm > Backtrace: > In module/ice-9/boot-9.scm: > 170: 13 [catch #t # ...] > In unknown file: > ?: 12 [catch-closure] > In module/ice-9/boot-9.scm: > 62: 11 [call-with-prompt prompt0 ...] > In module/ice-9/eval.scm: > 389: 10 [eval # #] > In module/ice-9/boot-9.scm: > 1864: 9 [save-module-excursion #] > 1172: 8 [load "./compile-cache-run-problem.scm" #f] > In unknown file: > ?: 7 [load-compiled/vm "/home/janneke/.cache/guile/ccache/2.0-0.T-LE-4/home/janneke/vc/schikkers-list/compile-cache-run-problem.scm.go"] > In ./compile-cache-run-problem.scm: > 20: 6 [#] > In module/oop/goops.scm: > 1552: 5 [# #] > In unknown file: > ?: 4 [%initialize-object #< 8b01010> ()] > In module/oop/goops.scm: > 1552: 3 [# #] > In ./compile-cache-run-problem.scm: > 12: 2 [# # ...] > In module/ice-9/boot-9.scm: > 115: 1 [# unbound-variable ...] > In unknown file: > ?: 0 [catch-closure unbound-variable "module-lookup" ...] > > ERROR: In procedure module-lookup: > ERROR: Unbound variable: for-each > [1]12:47:17 janneke@vuurvlieg:~/vc/schikkers-list > $ Guile now exhibits the second behavior only, and not the first behavior. I think the reason is that map and for-each are now implemented in Scheme, and thus not primitive generics, and srfi-1 doesn't turn them into generics any more. Since the duplicates-handler thing is actually a list or handlers, and you don't mention `last' in the list, no binding for `for-each' gets imported. I suspect the difference between first and second runs had to do with the interaction between srfi-1 and goops, combined with the loading-order bug that I fixed. Yuk, right? Strictly speaking this recent map / srfi-1 / goops change is incompatible. But, I hope you'll agree it's for the better; do let us know if you need some sort of compatibility shim. Andy -- http://wingolog.org/