Re: Uploading Word documents, PDFs, PNG files etc

2009-05-20 Thread Sebastian Tennant
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

Re: Uploading Word documents, PDFs, PNG files etc

2009-05-18 Thread Sebastian Tennant
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

Re: Uploading Word documents, PDFs, PNG files etc

2009-05-18 Thread Sebastian Tennant
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=\"([^\"]*

Re: Uploading Word documents, PDFs, PNG files etc

2009-05-14 Thread Sebastian Tennant
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

Re: Uploading Word documents, PDFs, PNG files etc

2009-05-14 Thread Sebastian Tennant
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

Re: Uploading Word documents, PDFs, PNG files etc

2009-05-13 Thread Sebastian Tennant
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

Re: Uploading Word documents, PDFs, PNG files etc

2009-05-13 Thread Sebastian Tennant
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

Re: Uploading Word documents, PDFs, PNG files etc

2009-05-13 Thread Sebastian Tennant
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

Re: Uploading Word documents, PDFs, PNG files etc

2009-05-12 Thread Sebastian Tennant
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

Re: Uploading Word documents, PDFs, PNG files etc

2009-05-12 Thread Sebastian Tennant
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

Uploading Word documents, PDFs, PNG files etc

2009-05-10 Thread Sebastian Tennant
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

Re: Replacing substrings in strings

2009-04-15 Thread Sebastian Tennant
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

Re: Replacing substrings in strings

2009-04-15 Thread Sebastian Tennant
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

Replacing substrings in strings

2009-04-14 Thread Sebastian Tennant
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))

Re: Broken pipe errors using guile-pg with guile 1.8

2009-02-23 Thread Sebastian Tennant
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.

Broken pipe errors using guile-pg with guile 1.8

2009-02-23 Thread Sebastian Tennant
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

Re: Guile and SLIB

2009-01-27 Thread Sebastian Tennant
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

Re: Dynamic variable binding

2008-12-29 Thread Sebastian Tennant
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

Re: Dynamic variable binding

2008-12-27 Thread Sebastian Tennant
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

Re: Placement of defines

2008-12-27 Thread Sebastian Tennant
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

Re: Dynamic variable binding

2008-12-19 Thread Sebastian Tennant
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

Re: Dynamic variable binding

2008-12-19 Thread Sebastian Tennant
> 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:

Re: Placement of defines

2008-12-19 Thread Sebastian Tennant
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) >>

Re: Placement of defines

2008-12-18 Thread Sebastian Tennant
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

Placement of defines

2008-12-18 Thread Sebastian Tennant
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

Re: Error reporting

2008-12-01 Thread Sebastian Tennant
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

Re: Error reporting

2008-11-26 Thread Sebastian Tennant
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

Re: Error reporting

2008-11-22 Thread Sebastian Tennant
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

Error reporting

2008-11-20 Thread Sebastian Tennant
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

Re: guile history: your input needed!

2008-11-20 Thread Sebastian Tennant
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],

Re: Dynamic variable binding

2008-11-15 Thread Sebastian Tennant
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

Re: Dynamic variable binding

2008-11-13 Thread Sebastian Tennant
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

Re: Dynamic variable binding

2008-11-13 Thread Sebastian Tennant
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

Dynamic variable binding

2008-11-12 Thread Sebastian Tennant
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") '(

Re: Guile release planning

2008-11-11 Thread Sebastian Tennant
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

Re: guile-db

2008-10-23 Thread Sebastian Tennant
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

Re: guile-db

2008-10-22 Thread Sebastian Tennant
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

Re: guile-db

2008-10-22 Thread Sebastian Tennant
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

Re: guile-db

2008-10-20 Thread Sebastian Tennant
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

Re: guile-db

2008-10-17 Thread Sebastian Tennant
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-

Re: guile-db

2008-10-16 Thread Sebastian Tennant
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.

Re: guile-db

2008-10-15 Thread Sebastian Tennant
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

Re: scheme -> (X)HTML

2008-06-21 Thread Sebastian Tennant
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

Re: scheme -> (X)HTML

2008-06-13 Thread Sebastian Tennant
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

Re: ttn-pers-scheme & ttn-do

2008-04-12 Thread Sebastian Tennant
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

Process management under guile

2008-04-03 Thread Sebastian Tennant
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 procedure index

2008-04-03 Thread Sebastian Tennant
Another procedure missing from the info manual: set-batch-mode?! Sebastian

Re: Debian guile-1.8 and ttn guile-pg

2008-03-31 Thread Sebastian Tennant
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

file-exists? missing from procedure index

2008-03-30 Thread Sebastian Tennant
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

Re: SLIB and ice-9 slib module

2008-03-30 Thread Sebastian Tennant
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

Re: Debian guile-1.8 and ttn guile-pg

2008-03-30 Thread Sebastian Tennant
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

Re: SLIB and ice-9 slib module

2008-03-30 Thread Sebastian Tennant
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-

Re: Debian guile-1.8 and ttn guile-pg

2008-03-30 Thread Sebastian Tennant
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

Debian guile-1.8 and ttn guile-pg

2008-03-29 Thread Sebastian Tennant
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

Re: SLIB and ice-9 slib module

2008-03-27 Thread Sebastian Tennant
[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

Re: ice-9 r4rs

2008-03-19 Thread Sebastian Tennant
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

Re: ttn-pers-scheme & ttn-do

2008-03-19 Thread Sebastian Tennant
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 >

Re: CGI scripting with Guile

2008-03-19 Thread Sebastian Tennant
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

ice-9 r4rs

2008-03-18 Thread Sebastian Tennant
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

SLIB and ice-9 slib module

2008-03-18 Thread Sebastian Tennant
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

ttn-pers-scheme & ttn-do

2008-03-18 Thread Sebastian Tennant
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

Re: CGI scripting with Guile

2008-03-18 Thread Sebastian Tennant
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...

Re: CGI scripting with Guile

2008-03-16 Thread Sebastian Tennant
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

Re: CGI scripting with Guile

2008-03-16 Thread Sebastian Tennant
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?

Re: CGI scripting with Guile

2008-03-16 Thread Sebastian Tennant
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

Re: CGI scripting with Guile

2008-03-16 Thread Sebastian Tennant
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

Re: CGI scripting with Guile

2008-03-15 Thread Sebastian Tennant
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

Re: CGI scripting with Guile

2008-03-15 Thread Sebastian Tennant
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

Re: CGI scripting with Guile

2008-03-15 Thread Sebastian Tennant
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

CGI scripting with Guile

2008-03-15 Thread Sebastian Tennant
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

Re: apply and open-pipe*

2008-03-02 Thread Sebastian Tennant
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.

apply and open-pipe*

2008-03-02 Thread Sebastian Tennant
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

Re: File local variables

2008-02-08 Thread Sebastian Tennant
Whoops! Apologies to all. Wrong list :-) Sebastian

File local variables

2008-02-08 Thread Sebastian Tennant
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

Re: Parameters

2008-02-04 Thread Sebastian Tennant
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

Re: Parameters

2008-02-04 Thread Sebastian Tennant
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

Re: Parameters

2008-02-04 Thread Sebastian Tennant
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

Parameters

2008-02-04 Thread Sebastian Tennant
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: