From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Israelsson Tampe Newsgroups: gmane.lisp.guile.devel Subject: Re: trying to make fmt work under guile Date: Mon, 3 Jan 2011 23:41:11 +0100 Message-ID: <201101032341.11944.stefan.itampe@gmail.com> References: <201012302326.54381.stefan.itampe@gmail.com> <87aajh7tlb.fsf@delenn.lan> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1294094426 15550 80.91.229.12 (3 Jan 2011 22:40:26 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 3 Jan 2011 22:40:26 +0000 (UTC) Cc: guile-devel@gnu.org To: Andreas Rottmann Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Jan 03 23:40:21 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PZt4f-0006CK-1b for guile-devel@m.gmane.org; Mon, 03 Jan 2011 23:40:21 +0100 Original-Received: from localhost ([127.0.0.1]:52137 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PZt4e-000368-Dm for guile-devel@m.gmane.org; Mon, 03 Jan 2011 17:40:20 -0500 Original-Received: from [140.186.70.92] (port=49769 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PZt4T-00035w-DS for guile-devel@gnu.org; Mon, 03 Jan 2011 17:40:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PZt4R-0004cP-U5 for guile-devel@gnu.org; Mon, 03 Jan 2011 17:40:09 -0500 Original-Received: from mail-ew0-f41.google.com ([209.85.215.41]:52209) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PZt4R-0004cF-P2 for guile-devel@gnu.org; Mon, 03 Jan 2011 17:40:07 -0500 Original-Received: by ewy27 with SMTP id 27so7051480ewy.0 for ; Mon, 03 Jan 2011 14:40:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:cc:references:in-reply-to:mime-version:content-type :content-transfer-encoding:message-id; bh=Q6uzksM0aqBSjfQEgE0XDA+uXCIL5kImaVCPhyuvuRU=; b=TogjN5chTfxSSi7maFrtrQoK/BX4qwLyW0TokbmNDga6edXq2X+04Z8RSbOY7RmHov qq6L9X6pOC16Gi1YWlTeea6mtfypPXbaPIUIlc0WzB17uNYNj7Uvfwmp1KfPe+U55WB2 ygm/P0lP2g53dwib/OwWLF6z8us4cONWw+Pso= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding:message-id; b=er2aZ9uUJiZvUwIpzD+SRBOkqfbm6hC/Cl8KNiT3yeGPyxDeHvkUdGRvg0I5M1zkp/ SdVMvbukV+dGoNqSw2jhM1bjSXnGyO6fY7C/Y/ds0slDWVycS0bdJIuaC72MU0s27sQr CjHf3YR1I7kcLfUjDXI4jPstn5IpISWh3CO60= Original-Received: by 10.213.8.69 with SMTP id g5mr14236152ebg.70.1294094405926; Mon, 03 Jan 2011 14:40:05 -0800 (PST) Original-Received: from linux-s4gz.localnet (1-1-1-39a.veo.vs.bostream.se [82.182.254.46]) by mx.google.com with ESMTPS id x54sm15161351eeh.17.2011.01.03.14.40.04 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 03 Jan 2011 14:40:05 -0800 (PST) User-Agent: KMail/1.13.5 (Linux/2.6.34.7-0.5-desktop; KDE/4.4.4; x86_64; ; ) In-Reply-To: <87aajh7tlb.fsf@delenn.lan> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:11289 Archived-At: First of all, thanks for the answer :-) On Monday, January 03, 2011 07:03:28 pm Andreas Rottmann wrote: > Stefan Israelsson Tampe writes: > > Hi, > > > > I'm trying to package the fmt library. > > Note that there's already an R6RS adaption of "fmt" as part of the Wak > project [0], which works under Guile 1.9.x. Note that the test suite > ("tests/fmt.sps") doesn't work with Guile (yet), since Guile lacks > SRFI-64. However, my R6RS code using `fmt' also runs fine under Guile > 1.9.x. > > [0] http://gitorious.org/wak/wak-fmt > > To use it with Guile, put the (relevant) contents of both the `wak-fmt' > git repository and the `wak-common' one into some directory in your > Guile's load path; this can be achieved using the wak-install.sh script: > > % git clone git://gitorious.org/wak/wak-common.git > % git clone git://gitorious.org/wak/wak-fmt.git > % mkdir r6rs-libs > % wak-common/scripts/wak-install.sh wak-common r6rs-libs/wak > % wak-common/scripts/wak-install.sh wak-fmt r6rs-libs/wak > > You now should have r6rs-libs populated with all libraries needed for > `(wak fmt)': > > % guile -x .guile.sls -x .sls -L $(pwd)/r6rs-libs > [...] > scheme@(guile-user)> (import (wak fmt)) > scheme@(guile-user)> (fmt #t (cat 1 " " 2 "/" 3 nl)) > 1 2/3 > > All Wak packages are installable via dorodango[1], but unfortunatly > dorodango does not yet work with Guile due to Guile Bug #31472 [2]. > > [1] http://home.gna.org/dorodango/ > [2] https://savannah.gnu.org/bugs/?31472 > > > And have it compiling it's working on a simple test case. (I'll need > > it to produce nicely formatted c-code) I still need to export some > > symbols. But it seams to work at least in initiall test eh, actually > > just one simple test case :-). > > > > To note. > > > > 1. I need srfi-66 for unicode stuff, but can't find it in guile. any > > clues? > > Guile has R6RS bytevectors, which are basically SRFI-66 with differently > named identifiers. Given that, you can "emulate" SRFI-66 by importing > from `(rnrs bytevectors)' with renaming or by defining aliases. Note > that in wak-fmt, the "unicode stuff" is not yet adapted to R6RS -- > patches would be highly welcome! :-) Hmm, I'm too green yet in R6RS land to take on this. maybe I can attack this in a month or so. > > 2. I tryied (ice-9 optargs) but that failes and I had to use the supplied > > > > fmt-0.6/let-optionals.scm > > > > This to make LET-OPTIONALS* work properly. It seams that the ice-9 > > version don't allow define's in it's declaration part of the body. > > It doesn't help to put the code inside a body form. > > > > The error message is, > > > > [...] > > Apparently, `let-optional*' from `(ice-9 optargs)' allows this: > > scheme@(guile-user)> (define x '()) > scheme@(guile-user)> (let-optional* x (a b) (define a 1) a) > $2 = 1 > scheme@(guile-user)> (let-optional* x (a b) a) > $3 = #f > > It seems that `let-optional*' is incompatible to `let-optionals*' (which > originates from scsh, AFAIK) in at least one other way, however; it does > not allow a literal in the rest arg. Maybe there's another > incompatibility which is causing `fmt' to break. yes, more subtle than I thought but you answered me here. I wanted a description of what is known about this module. And when there is another library that works just fine, the need is as you say below just not that high to fix this. > I'd just use the `let-optionals*' implementation provided with `fmt', or > go with the Wak R6RS adaption. > > Regards, Rotty Again, Thanks!