* trying to make fmt work under guile
@ 2010-12-30 22:26 Stefan Israelsson Tampe
2011-01-03 18:03 ` Andreas Rottmann
0 siblings, 1 reply; 3+ messages in thread
From: Stefan Israelsson Tampe @ 2010-12-30 22:26 UTC (permalink / raw)
To: guile-devel
Hi,
I'm trying to package the fmt library. 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?
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,
;;; WARNING: compilation of
/home/stis/src/guile/module/language/clambda/fmt.scm failed:
;;; key syntax-error, throw args (macroexpand "~a in subform `~s' of `~s'"
;;; ("definition in expression context" write-positive (lambda (n) (let* ((m+e
;;; (mantissa+exponent (exact->inexact n)))
Is this a bug?
Happy new year
Stefan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: trying to make fmt work under guile
2010-12-30 22:26 trying to make fmt work under guile Stefan Israelsson Tampe
@ 2011-01-03 18:03 ` Andreas Rottmann
2011-01-03 22:41 ` Stefan Israelsson Tampe
0 siblings, 1 reply; 3+ messages in thread
From: Andreas Rottmann @ 2011-01-03 18:03 UTC (permalink / raw)
To: Stefan Israelsson Tampe; +Cc: guile-devel
Stefan Israelsson Tampe <stefan.itampe@gmail.com> 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!
> 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.
I'd just use the `let-optionals*' implementation provided with `fmt', or
go with the Wak R6RS adaption.
Regards, Rotty
--
Andreas Rottmann -- <http://rotty.yi.org/>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: trying to make fmt work under guile
2011-01-03 18:03 ` Andreas Rottmann
@ 2011-01-03 22:41 ` Stefan Israelsson Tampe
0 siblings, 0 replies; 3+ messages in thread
From: Stefan Israelsson Tampe @ 2011-01-03 22:41 UTC (permalink / raw)
To: Andreas Rottmann; +Cc: guile-devel
First of all, thanks for the answer :-)
On Monday, January 03, 2011 07:03:28 pm Andreas Rottmann wrote:
> Stefan Israelsson Tampe <stefan.itampe@gmail.com> 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!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-01-03 22:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-30 22:26 trying to make fmt work under guile Stefan Israelsson Tampe
2011-01-03 18:03 ` Andreas Rottmann
2011-01-03 22:41 ` Stefan Israelsson Tampe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).