Quoth l...@gnu.org (Ludovic Courtès):
> Hello,
>
> Sebastian Tennant writes:
>
>> Content-Disposition is mandatory, but Content-Type is optional
>> (defaulting to text/plain) as is Content-Transfer-Encoding, so the
>> "header part" of any given MIME part ma
Quoth Sebastian Tennant :
> so the "header part" of any given MIME part may be a single line or it
> may be three.
Correction - ...it may be a single line, or it may be two, or three.
Seb
--
Emacs' AlsaPlayer - Music Without Jolts
Lightweight, full-featured and mindful of y
Hi Ludo,
Thanks for responding. I know this isn't really your 'thing' (for want
of a better word).
Quoth l...@gnu.org (Ludovic Courtès):
>> cgi.scm currently uses the following patterns and I can't think of an
>> alternative way of doing it:
>>
>> (let ((name-rx (make-regexp "name=\"([^\"]*
Quoth Sebastian Tennant :
> Multipart/form-data comes with a Content-Length header that describes
Correction - the above should read 'CONTENT_LENGTH environment variable'.
> The boundary can be obtained from the Content-Type header and the above
Similarly, the above should re
Quoth Keith Wright :
>> > Restricting regexps to actual text is fine... until
>> > you need to grep binary data, or, as in this case,
>> > a combination of text and binary data.
>>
>> > in cgi.scm that extracted the uploaded (possibly
>> > binary) file, because the pattern identifying the
>> > beg
Quoth l...@gnu.org (Ludovic Courtès):
> Hello,
>
> Sebastian Tennant writes:
>
>> (info "(guile-1.8)Regexp Functions")
>>
>> "Zero bytes (`#\nul') cannot be used in regex patterns or input
>> strings, since the underlying C functions
Quoth l...@gnu.org (Ludovic Courtès):
> Hello,
>
> Sebastian Tennant writes:
>
>> (info "(guile-1.8)Regexp Functions")
>>
>> "Zero bytes (`#\nul') cannot be used in regex patterns or input
>> strings, since the underlying C functions
Quoth Thien-Thi Nguyen :
> Perhaps you can convert the string in variable `upload' to a uniform
> vector and write it out using `uniform-vector-write'. It may be the
> case, too, that the string can be passed to `uniform-vector-write'
> directly
I've isolated the problem.
(info "(guile-1.8)Regex
Quoth l...@gnu.org (Ludovic Courtès):
> Sebastian Tennant writes:
>
>> (define (upload name)
>>(and=> (uploads name) car))
>
> [...]
>
>> P.S. Documentation bug - the procedure 'and=>' is missing from the
>> manual. What's th
Quoth Thien-Thi Nguyen :
> () Sebastian Tennant
> () Sun, 10 May 2009 16:21:29 +
>
> (with-output-to-file (string-append USER-UPLOAD-DIR upload-fname)
> (lambda ()
> (display upload)))
>
> Perhaps you can convert the string in variable `upl
Hi Guilers,
The following works fine for plain text files but fails with Word
documents, PDFs, PNG files and no doubt other (binary?) file types.
This error msg, followed by the contents of the file, is dumped on
stderr each time:
string contains #\nul character: "\x0d
Content-Disposition: for
Quoth l...@gnu.org (Ludovic Courtès):
> Otherwise, you could try using SRFI-13 as well if it's enough
> (consecutive spaces are coalesced here):
>
> (string-join (string-tokenize "hello, world.") " ")
> => "hello, world."
I need to only replace two consecutive spaces. Also string-tokenize (in
Quoth Linas Vepstas :
> 2009/4/14 Sebastian Tennant :
>> I needed to replace two consecutive spaces in strings with ' ' so
>
> Most programming languages use regex, and so does guile:
Of course it can be done using regexps, I'm just a little surprised
there isn
Hi Guilers,
I needed to replace two consecutive spaces in strings with ' ' so
I came up with this:
(define (replace-substring s t u)
"Return string S with all occurrences of string T replaced by string U."
(let ((rv ""))
(let loop ((r s)) ; r for 'remaining'
(let ((a 0) (b 0))
Quoth Greg Troxel :
> Sebastian Tennant writes:
>> Is anyone familiar with the internals of guile-pg (version 0.16, author
>> Ian Grant) which wraps PostgreSQL's libpq?
>
> By 0.16, I think you mean ttn's version of Ian Grant's abandoned 0.07 or
> so.
Hi Guilers,
Is anyone familiar with the internals of guile-pg (version 0.16, author
Ian Grant) which wraps PostgreSQL's libpq?
I'm getting a lot of 'broken pipe' errors of the sort:
Feb 23 11:32:13 stderr: ERROR: In procedure pg-connectdb:
Feb 23 11:32:13 stderr: ERROR: could not send startup
Quoth Tom Browder :
> I am trying to get guile 1.8.6 to work (use) slib
I had problems with SLIB a while ago and IIRC it's a [load-]path issue:
Perhaps something in the thread beginning here:
http://article.gmane.org/gmane.lisp.guile.user/6477
may help.
Sebastian
--
Emacs' AlsaPlayer - Musi
Quoth "Neil Jerram" :
> 2008/12/27 Sebastian Tennant :
>> Quoth Keith Wright :
>>
>>> "The name of the song is called 'Haddocks' eyes'." "Oh, that's the
>>> name of the song, is it?" Alice said. "No, you d
Quoth Keith Wright :
>> From: Sebastian Tennant
>>> Quoth Keith Wright :
>>> I don't know what happens (in Guile), but I can tell
>>> you what _should_ happen. (In my humble opinion as
>>> a demi-god of semantics.)
>> I'm trying
Quoth "Kjetil S. Matheussen" :
>> Sebastian Tennant:
>> guile> ((lambda (x) (set! x "baz\n") (definer 'bar x) (display bar)) "foo\n")
>> baz
>> guile>
>>
>
> Unfortunately, it's not the same. "definer" d
Quoth l...@gnu.org (Ludovic Courtès):
> Hi,
>
> Sebastian Tennant writes:
>
>> My semantic point is that the first argument to definer (above) is not a
>> symbol and it's not a variable (an unbound variable error would be
>> thrown if it was), so in the con
> Quoth Keith Wright :
>> From: Sebastian Tennant
>>
>> guile> (define-macro (definer var val)
>> `(define ,var ,val))
>> guile> (definer 'foo "bar")
>> guile> foo
>> ERROR: Unbound variable: foo
>> ABORT:
Quoth l...@gnu.org (Ludovic Courtès):
> Sebastian Tennant writes:
>
>> Incidentally, perhaps you can tell me why the first argument to this
>> compile-friendly macro has to be a string for it to work.
>>
>> guile> (define-macro (definer var val)
>>
Quoth "Kjetil S. Matheussen" :
> Yes, this limitation in Scheme is a horrible pest. There's no
> decent reason why you shouldn't be allowed to use define other
> places than right after a lambda, except the long discussion
> involved how it should behave in various situations. But even
> inconsista
Hi all,
Having read this interesting thread:
http://sourceware.org/ml/guile/1999-08/msg00118.html
I understand that internal definitions may not occur anywhere other than
at the beginning of the body of the enclosing expression, which explains
why this works:
((lambda (x) (define bar x) (disp
Quoth "Neil Jerram" <[EMAIL PROTECTED]>:
> 2008/11/26 Sebastian Tennant <[EMAIL PROTECTED]>:
>
>> Is this the sort of thing that might go down well on guile.sources?
>
> Yes! (What else would guile.sources be for?)
I suppose what I was/am really
Thanks for the suggestions guys.
I was already using soft output ports for writing controlled debugging
information to log files, and it never occurred to me to simply add:
(set-current-error-port )
to the top of my scripts!
Incidentally, I've written a module that wraps /usr/bin/logger and a
Quoth Jon Wilson <[EMAIL PROTECTED]>:
> If this is added, I'd very much recommend including a way to turn it
> off (or more likely to turn it on), as extra noise in error messages
> generally comes at the price of quick understanding. Most of the
> time, timestamps aren't needed, so, except when t
Hi all,
I very much doubt it's possible, but is there any way of getting Guile
to include a timestamp in it's error reporting?
For example:
guile> foo
2008-11-20 23:17:11 ERROR: Unbound variable: foo
2008-11-20 23:17:11 ABORT: (unbound-variable)
Sebastian
Quoth "Neil Jerram" <[EMAIL PROTECTED]>:
> 2008/11/20 Andy Wingo <[EMAIL PROTECTED]>:
>> Hey Guilers!
>>
>> Many (most?) of you have been at this guile thing for longer than I
>> have, some of you from the very beginning. While doing some
>> reorganizations to the manual to get the VM docs in [0],
Quoth Jon Wilson <[EMAIL PROTECTED]>:
> Sebastian Tennant wrote:
>> Quoth [EMAIL PROTECTED] (Ludovic Courtès):
>>> Dynamic binding definition is compilation-unfriendly. Kjetil's
>>> proposed `define-lotsof' macro is more appropriate, as it can be fu
Quoth [EMAIL PROTECTED] (Ludovic Courtès):
> Dynamic binding definition is compilation-unfriendly. Kjetil's
> proposed `define-lotsof' macro is more appropriate, as it can be fully
> evaluated at compile-time (should a compiler be used, that is),
> whereas the `module-define!' trick requires that
Quoth Sebastian Tennant <[EMAIL PROTECTED]>:
Hi all,
Many thanks to all responders, especially to Ludo' for answering my
question directly.
The macro definition I was searching for is simply this:
(define-macro (definer var val) ;var must be a symbol
`(module-define! (current-m
Hi all,
An elementary scheme problem from an elementary schemer...
I need to create multiple variable bindings from a list of symbols. The
value of the variables is unimportant. It's the 'names' of the
variables that matter.
In pseudo-scheme code:
(map (lambda (v) (define (eval v) "foo") '(
Quoth "Neil Jerram" <[EMAIL PROTECTED]>:
> In my view, when we add in [the community focus] angle, the steady new
> feature model is better.
As a non-developer, but committed user, I couldn't agree more.
Sebastian
Quoth "Neil Jerram" <[EMAIL PROTECTED]>:
> 2008/10/23 Sebastian Tennant <[EMAIL PROTECTED]>:
>>
>> Are you planning to release a 1.8-compatible guile-pg pkgsrc package
>> anytime soon?
>
> FWIW, I'm going to have a go at this (1.8-compatible g
Quoth Greg Troxel <[EMAIL PROTECTED]>:
>>> I think you are referring to guile-pg 0.07
>>
>> I'm referring to whichever guile-pg you get when you issue the command
>> 'apt-get install guile-pg' on a stock Debian box.
>
> Sorry, but that means you don't know Which version it is.
Indeed it does. Bu
Quoth Greg Troxel <[EMAIL PROTECTED]>:
> It's less work to write the wrapper to ttn's version.
Quoth <[EMAIL PROTECTED]>:
> Clinton Ebadi <[EMAIL PROTECTED]> wrote:
>
>> (define-module (pg whatever)
>> #:export (guile-pg symbols ...))
>>
>> (load-extension "libwhateverpg" "guile
Quoth Greg Troxel <[EMAIL PROTECTED]>:
> but...
>
> "To build Guile-PG you need to have installed both the PostgreSQL
>frontend library libpq, and a version of Guile that can load binary
>module (a b c) from file a/b/c.so or a/b/c/libc.la under `%load-path'."
>
> I believe the last bi
Quoth "Linas Vepstas" <[EMAIL PROTECTED]>:
> 2008/10/16 Sebastian Tennant <[EMAIL PROTECTED]>:
>
>> guile-pg is definitely more feature-full in that case. and ttn's
>> guile-1.4 compatible guile-pg is much more fetaure-full than the
>> guile-
Quoth "Linas Vepstas" <[EMAIL PROTECTED]>:
> 2008/10/15 Sebastian Tennant <[EMAIL PROTECTED]>:
>> Quoth "Linas Vepstas" <[EMAIL PROTECTED]>:
>>> Dunno. However, fyi, I'm maintaining guile-dbi, which wraps
>>> postgres and mysql.
Quoth "Linas Vepstas" <[EMAIL PROTECTED]>:
> 2008/10/14 betoes <[EMAIL PROTECTED]>:
>> Hello list,
>>
>> In the Debian distro, there is a packge named guile-db, which refers to a
>> Berkeley DB wrap for Guile. Do someone know if it is active? If there is a
>> repository or web page? I tried the mai
Quoth "Neil Jerram" <[EMAIL PROTECTED]>:
> OK, I've checked now, and it appears that the code already posted is
> the most up to date that I have.
Noted.
>> guile> (process-template "/path/to/version.html" ((foo 'bar)) (ice-9 rdelim))
>> [...]
>> :1:1: Unbound variable: begin
>> ABORT: (unbound-v
Neil Jerram <[EMAIL PROTECTED]> writes:
> As a further option, please see attached [template.scm]. If you're
> interested in this, please let me know, because I may have a more up
> to date version somewhere.
I'd be interested in getting hold of the latest version of
template.scm as it does exact
Quoth Thien-Thi Nguyen <[EMAIL PROTECTED]>:
> () Sebastian Tennant <[EMAIL PROTECTED]>
> () Wed, 19 Mar 2008 13:08:37 +0200
>
>What was this special exception and was it the reason for the fork?
>
> The fork was over deprecation of some libguile API elements, plu
Hi all,
Reading the Guile manual on pipes and ports and file descriptors and
sessions... has made me realise that my understanding of processes and
their underlying complexity is severely lacking.
Emacs' call-process and start-process procedures make management of
synchronous and asynchronous pro
Another procedure missing from the info manual:
set-batch-mode?!
Sebastian
Quoth <[EMAIL PROTECTED]>:
> Greg Troxel <[EMAIL PROTECTED]> wrote:
>> [guile-pg and guile 1.8]
>>
>> I was hoping his guile-pg would work because it doesn't explicity
>> state that a 1.4.x guile is required like some of his other packages
>> do.
>>
>> It works fine under 1.6. What
Hi there,
The subject line says it all really.
$ dpkg -l | sed 1,5d | grep guile-1.8-doc
ii guile-1.8-doc-non-dfsg 1.8.4+1-1 Reference documentation for Guile 1.8
Sebastian
Quoth [EMAIL PROTECTED] (Ludovic Courtès):
> Hi,
>
> Sebastian Tennant <[EMAIL PROTECTED]> writes:
>
>> The documentation reads:
>>
>> 2. Define the `SCHEME_LIBRARY_PATH' environment variable:
>>
>> $ SCHEME_LIBRARY_PATH=/usr/loca
David Pirotte <[EMAIL PROTECTED]> writes:
> Le Sun, 30 Mar 2008 15:11:58 +0300,
> Sebastian Tennant <[EMAIL PROTECTED]> a écrit :
>
>> Quoth David Pirotte <[EMAIL PROTECTED]>:
>> > Here is a package for debian that Dale Smith produced for me a month
Sebastian Tennant <[EMAIL PROTECTED]> writes:
> /usr/share/guile/1.8/ looks like this:
>
> /usr/share/guile/1.8:
> total used in directory 308 available 2752472
> drwxr-xr-x 7 root root116 Mar 27 14:22 .
> drwxr-xr-x 3 root root 16 Feb 28 23:59 ..
> -rw-r-
Quoth David Pirotte <[EMAIL PROTECTED]>:
> Here is a package for debian that Dale Smith produced for me a month
> or so ago.
Many thanks David.
I did see your list posting and I was considering writing to you
directly, but I though I'd enquire about ttn's version first because it
seems much furt
Hi list,
Has anyone successfully built ttn's guile-pg (0.36) using Debian's
guile-1.8?
Needless to say I haven't been able to get it to work.
I can run configure successfully once I tell it where Debian's
libpq-dev package puts the libpq includes:
./configure --with-libpq-includes=/usr/includ
[EMAIL PROTECTED] (Ludovic Courtès) writes:
> Sorry for the delay...
No problem. Thanks for your reply.
> Sebastian Tennant <[EMAIL PROTECTED]> writes:
>
>> An apt-installed slib:
>>
>> /usr/share/slib
>
> IIRC, the layout of the Debian `slib
Quoth [EMAIL PROTECTED] (Ludovic Courtès):
> Both procedures are bound by default.
Hmm... so they are. Last night must have been their night off... or
mine perhaps :-)
Seb
Quoth Thien-Thi Nguyen <[EMAIL PROTECTED]>:
> () Sebastian Tennant <[EMAIL PROTECTED]>
> () Tue, 18 Mar 2008 22:20:15 +0200
>
> checking if (guile-user) exports `close-all-fdes-except'... no
> configure: error: module (guile-user) does not export
>
Quoth Thien-Thi Nguyen <[EMAIL PROTECTED]>:
> () Sebastian Tennant <[EMAIL PROTECTED]>
>Hmm, OK. Again, just out of interest, why doesn't a simple
>
> [EMAIL PROTECTED]@ -s
> !#
>
>suffice?
>
> It probably would, in this case. F
Hi,
(info "(guile-1.8)File Ports")
-- Scheme Procedure: open-input-file filename
Open FILENAME for input. Equivalent to
(open-file FILENAME "r")
-- Scheme Procedure: open-output-file filename
Open FILENAME for output. Equivalent to
(open-file FILENAM
Hi all,
A Debian box with an apt-installed guile-1.8:
/usr/share/guile/1.8
An apt-installed slib:
/usr/share/slib
Created symlink:
/usr/share/guile/1.8/slib -> /usr/share/slib
Set environment variables:
export GUILE_IMPLEMENTATION_PATH="/usr/share/guile/1.8/"
export SCHEME_LIBRARY_PATH
Hi thi,
$ cd ttn-pers-scheme-0.50
$ ./configure
checking whether ln -s works... yes
checking whether make sets $(MAKE)... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking for install-info... install-info
checking for guile... /usr/bin/guile
checking for guile-confi
Quoth Thien-Thi Nguyen <[EMAIL PROTECTED]>:
> () Sebastian Tennant <[EMAIL PROTECTED]>
> () Sun, 16 Mar 2008 14:56:20 +0200
>
>This is incredibly useful. Thank you for pointing it out.
>
> You're welcome. If you find any bugs in it, i'm all ears...
Quoth Thien-Thi Nguyen <[EMAIL PROTECTED]>:
> () Sebastian Tennant <[EMAIL PROTECTED]>
> () Sun, 16 Mar 2008 14:51:19 +0200
>
> guile> (www:get "http://www.../hw.scm";)
> ""
> guile> (www:http-head-get "http://www.../hw.scm
Quoth Thien-Thi Nguyen <[EMAIL PROTECTED]>:
> Appended is examples/id.cgi.in
This is incredibly useful. Thank you for pointing it out.
Just out of curiostiy, why the '.in' file extension? Is it to do with
make?
> #!/bin/sh
> exec @GUILE@ -s $0 "$@" # -*- scheme -*-
> !#
Also, why the shell?
Quoth Thien-Thi Nguyen <[EMAIL PROTECTED]>:
> What does the client see for the second case?
#!/usr/bin/guile -s
!#
(use-modules (www cgi)) ;LOAD
(cgi:init) ;INIT
(simple-format
#t
"Content-Type: text/plain\r\n\r\n~A"
"hello world")
---/---
guile> (ww
Quoth Thien-Thi Nguyen <[EMAIL PROTECTED]>:
>How is [CRLF] achieved (in scheme (lisp) forms)?
>
> You can use the characters #\cr and #\newline, or the string "\r\n".
I can do that :-)
> Probably `procedure-source' is a poor way to learn how `cgi:init'
> works; better to look at cgi.scm dire
Quoth Thien-Thi Nguyen <[EMAIL PROTECTED]>:
> What does the client see for the second case?
I will use a Guile http request and hopefully then I'll be able to give
you an intelligent answer.
> I think both cases are malformed; IIRC, HTTP header lines need to end
> in CRLF, not just LF.
How is th
Quoth Sebastian Tennant <[EMAIL PROTECTED]>:
> Quoth Sebastian Tennant <[EMAIL PROTECTED]>:
>> The additional line works in a guile process running on the server.
>
> I should have said
>
> a guile REPL(?) shell like thing
>
> not just
>
> a guile
Quoth Sebastian Tennant <[EMAIL PROTECTED]>:
> The additional line works in a guile process running on the server.
I should have said
a guile REPL(?) shell like thing
not just
a guile process
S
Hi list,
This CGI script:
#!/usr/bin/guile -s
!#
(display "Content-Type: text/plain
hello world")
works.
But this CGI script:
#!/usr/bin/guile -s
!#
(use-modules (www cgi))
(display "Content-Type: text/plain
hello world")
doesn't.
Why doesn't the second script work? The additi
Quoth Sebastian Tennant <[EMAIL PROTECTED]>:
> How can I work around this limitation, or am I just doing something
> wrong?
Doh! Forget it. I know what I'm doing wong. No need to quote the
function.
Hi list,
I want to provide a list of strings the open-pipe* function using apply,
but guile doesn't seem ot like 'apply'ing lists to open-pipe*
guile> (use-modules (ice-9 popen) (ice-9 rdelim))
guile> (define temp-port #f)
guile> (set! temp-port (apply 'open-pipe* OPEN_READ "ls" '("-l")))
Ba
Whoops! Apologies to all.
Wrong list :-)
Sebastian
Hi list,
I've tried oddmuse and oddmuse-mode, markdown and markdown-mode and now
it's the turn of Emacs Muse and muse-mode.
They're all different of course.
Oddmuse is a great wiki engine (and oddmuse-mode makes light work of
navigating pages and submitting new or edited pages, directly from
Ema
Quoth [EMAIL PROTECTED] (Ludovic Courtès):
>>> (define add
>>> (lambda (l)
>>> (let loop ((l l)
>>> (result 0))
>>> (if (null? l)
>>> result
>>> (loop (cdr l) (+ result (car l)))
>>
>> Noted.
>
> Or, more elegantly:
>
> (use-modules
Quoth Chusslove Illich <[EMAIL PROTECTED]>:
>> [: Sebastian Tennant :]
>> Why does the second procedure fail regardless of how it is called?
>
> Because the recursive call in it is of the first type, not corresponding to
> the base call.
Ah, of course...
> Yo
Quoth [EMAIL PROTECTED] (Ludovic Courtès):
> Sebastian Tennant <[EMAIL PROTECTED]> writes:
>> This simple procedure behaves as expected, i.e., it provides the sum of
>> a list of numbers:
>>
>> (define add
>>(lambda (l)
>> (if (null? l)
&g
Hi list,
No doubt something of a newbie question this...
This simple procedure behaves as expected, i.e., it provides the sum of
a list of numbers:
(define add
(lambda (l)
(if (null? l)
0
(+ (add (cdr l)) (car l)
whereas this procedure results in a stack overflow:
78 matches
Mail list logo