Re: [Chicken-users] libsvm

2015-05-19 Thread Daishi Kato
Thanks to Mario,

I uploaded the modified version at:
https://code.call-cc.org/svn/chicken-eggs/release/4/libsvm/branches/using-gc/

Best,
Daishi

On Mon, 18 May 2015 21:19:18 +0900,
Christian Kellermann wrote:
> 
> Daishi Kato  writes:
> 
> > I haven't been following chicken recently,
> > so forgive me if I misunderstand the procedure.
> 
> Thanks for your contribution!
> 
> Please find information on how to proceed here:
> 
> http://wiki.call-cc.org/contribute
> 
> In short:
> 
> Mail mario a generated password hash or contact the original author of
> that egg.
> 
> Thanks again!
> 
> Christian
> 
> -- 
> May you be peaceful, may you live in safety, may you be free from
> suffering, and may you live with ease.
> 
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] libsvm

2015-05-18 Thread Daishi Kato
Dear somebody,

I haven't been following chicken recently,
so forgive me if I misunderstand the procedure.

I updated the libsvm egg and want to share it.
How can I do it? I have a branch in my local checked-out svn repo,
but I do not have the permission to commit it, saying:

$ svn commit -m 'improved version of libsvm'
Adding branches
svn: E195023: Commit failed (details follow):
svn: E195023: Changing directory 
'/home/daishi/src/call-cc.org/chicken-eggs/release/4/libsvm/branches' is 
forbidden by the server
svn: E175013: Access to '/svn/chicken-eggs/!svn/ver/23920/release/4/libsvm' 
forbidden
svn: E175002: Additional errors:
svn: E175002: CHECKOUT of '/svn/chicken-eggs/!svn/ver/23920/release/4/libsvm': 
403 Forbidden


Best,
Daishi

On Sat, 18 Oct 2014 23:12:22 +0900,
Daishi Kato wrote:
> 
> Hi Peter,
> 
> Are you still maintaining the libsvm egg?
> 
> http://wiki.call-cc.org/eggref/4/libsvm
> 
> Thanks.
> --daishi

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] libsvm

2014-10-18 Thread Daishi Kato
Hi Peter,

Are you still maintaining the libsvm egg?

http://wiki.call-cc.org/eggref/4/libsvm

Thanks.
--daishi

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Why does the JSON egg map JSON structs to Scheme vectors instead of alists?

2011-11-27 Thread Daishi Kato
Even though I agree that it should be schemish,
it must be consistent.

How would you deal with
{"1":[2,3],"4":[5,6]}
and
[["1",2,3],["4",5,6]]
that must be distinguished?

Furthermore, if we were to change the spec of the json egg,
we should be aware with backward compatibility issues.
Otherwise, I need to change my all json-related code.

Best,
Daishi

At Sun, 27 Nov 2011 14:16:38 +0100,
Vok Vojwo wrote:
> 
> I am a bit confused by the way the JSON egg maps JSON structures to
> Scheme values. The JSON egg maps a structure to a vector:
> 
> (use json)
> (with-input-from-string "{\"pi\":3.14,\"e\":2.71}" json-read)
> ;; => #(("pi" . 3.14) ("e" . 2.71))
> 
> This makes it impossible to use the standard Scheme function assoc to
> read the data.
> 
> The following functions fix the problem:
> 
> (define (json->alist arg)
>   (cond
>((vector? arg)
> (map (lambda (pair)
>(cons (car pair) (json->alist (cdr pair
>  (vector->list arg)))
>((list? arg)
> (list->vector (map json->alist arg)))
>(else arg)))
> 
> (define (alist->json arg)
>   (cond
>((list? arg)
> (list->vector (map (lambda (pair)
>  (cons (car pair) (alist->json (cdr pair
>arg)))
>((vector? arg)
> (map alist->json (vector->list arg)))
>(else arg)))
> 
> A small verification test:
> 
> (use http-client)
> 
> (define (with-input-from-url url chunk)
>   (with-input-from-request url #f chunk))
> 
> (define json
>   (with-input-from-url
>
> "http://www.google.com/calendar/feeds/developer-calen...@google.com/public/full?alt=json";
>json-read))
> 
> (equal? json (alist->json (json->alist json)))
> ;; => #t
> 
> By using alists it is possible to use assoc to access the data:
> 
> (define (assoc* alist . path)
>   (let assoc* ((path path)
>(alist alist))
> (if (null? path)
> alist
> (assoc* (cdr path)
> (cdr (assoc (car path) alist))
> 
> (assoc* (json->alist json) "feed" "title" "$t")
> ;; => "Official Google External Developer Events"
> 
> Is there any reason why the JSON egg creates vectors of pairs?
> 
> If not I would suggest to fix it to make it more schemish.
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Chicken vs Perl

2011-09-20 Thread Daishi Kato
At Tue, 20 Sep 2011 15:18:30 +0200,
Peter Bex wrote:
> 
> On Tue, Sep 20, 2011 at 10:08:16PM +0900, Daishi Kato wrote:
> > Hi,
> > 
> > My situation is pretty similar to yours, meaning I used to use Perl
> > and later started using Chicken for my job.
> > 
> > Running your scripts on my machine produced similar result
> > (about 10 times difference).
> > 
> > -unsafe option in csc-4.6.0 didn't work (no change).
> > -unsafe-libraries in csc-4.0.0 did work (a little faster),
> > but it's not available in csc-4.6.0 (does anybody know why?).
> > 
> > I also tried with csc-4.7.0, and guess what, it's a little slower
> > (at least on my test data. I partially crawled wiki.call-cc.org).
> > Peter, how could this happen?
> 
> This probably depends on the nature of your regex.  We made the
> tradeoff that large consecutive ranges of characters are stored
> more efficiently as a range instead of as separate characters.
> This means that if you are using a regex with many separate chars
> it could be slightly slower.
> 
> In some cases regexes can't be compiled to DFA but need to use
> backtracking, which is comparatively slow.   That's not the case
> in Sascha's regex (I checked), but might be the reason it's slow
> for you.

I would like to note that I used the script that Sascha posted.

Let me try with a somewhat larger test set.

% wget -r -l2 http://wiki.call-cc.org/manual/index
% du -s wiki.call-cc.org
2528wiki.call-cc.org

% time /usr/local/chicken-4.7.0/bin/csi -s a.scm wiki.call-cc.org > /dev/null
/usr/local/chicken-4.7.0/bin/csi -s a.scm wiki.call-cc.org > /dev/null  3.88s 
user 0.16s system 85% cpu 4.708 total

% time /usr/local/chicken-4.6.0/bin/csi -s a.scm wiki.call-c
c.org > /dev/null
/usr/local/chicken-4.6.0/bin/csi -s a.scm wiki.call-cc.org > /dev/null  3.13s 
user 0.13s system 86% cpu 3.771 total

% grep regexp a.scm
(define href (regexp "href=\"(http://[^\"/?]+)([\"/?].*)" #t))

% uname -r -v -o
2.6.39-2-686-pae #1 SMP Tue Jul 5 03:48:49 UTC 2011 GNU/Linux


Best,
Daishi

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Chicken vs Perl

2011-09-20 Thread Daishi Kato
Hi,

My situation is pretty similar to yours, meaning I used to use Perl
and later started using Chicken for my job.

Running your scripts on my machine produced similar result
(about 10 times difference).

-unsafe option in csc-4.6.0 didn't work (no change).
-unsafe-libraries in csc-4.0.0 did work (a little faster),
but it's not available in csc-4.6.0 (does anybody know why?).

I also tried with csc-4.7.0, and guess what, it's a little slower
(at least on my test data. I partially crawled wiki.call-cc.org).
Peter, how could this happen?

My guess is that read-line is slower than <> in perl.
(I think <> is so optimized in perl.)
This is just my guess and there's no guarantee,
but how about comparing with using read-all in chicken and $/=undef in perl?

Best,
Daishi

At Tue, 20 Sep 2011 14:11:41 +0200,
Sascha Ziemann wrote:
> 
> I tried to use Chicken for a job I would use normally Perl for to find
> out whether Chicken might be a useful alternative.
> 
> The job is: go through a web site mirror and report a unique list of
> all domains from all hrefs.
> 
> This is the my Perl version:
> 
> #! /usr/bin/perl
> 
> use warnings;
> use strict;
> use File::Find;
> 
> my $dir = $ARGV[0] || '.';
> my @files;
> my %urls;
> 
> find ({wanted => sub { push @files, $_ if -f $_; },
>no_chdir => 1}, $dir);
> 
> foreach my $file (@files) {
> open (HTML, $file) || die "Can not open file '$file'";
> while () {
> while (/href="(http:\/\/[^"\/?]+)(["\/?].*)/i) {
> $urls{lc $1} = 1;
> $_ = $2; } }
> close (HTML); }
> 
> foreach my $url (sort keys %urls) {
> print $url, "\n"; }
> 
> The Perl version takes for my test tree about two seconds:
> 
> real  0m1.810s
> user  0m1.664s
> sys   0m0.140s
> 
> And this is my Chicken version:
> 
> #! /usr/local/bin/csi -s
> 
> (require-extension posix regex srfi-69)
> 
> (define dir (let ((args (command-line-arguments)))
>   (if (pair? args)
>   (car args)
>   ".")))
> (define files (find-files dir regular-file?))
> (define urls (make-hash-table))
> (define href (regexp "href=\"(http://[^\"/?]+)([\"/?].*)" #t))
> 
> (for-each
>  (lambda (filename)
>(with-input-from-file filename
>  (lambda ()
>(let next-line ((line (read-line)))
>  (if (not (eof-object? line))
>  (let next-href ((found (string-search href line)))
>(if found
>(begin
>  (hash-table-set! urls (string-downcase (cadr found)) #t)
>  (next-href (string-search href (caddr found)
>(next-line (read-line
>  files)
> 
> (for-each
>  (lambda (arg)
>(printf "~a\n" arg))
>  (sort (hash-table-keys urls) string 
> And now hold on tight! It takes more than one minute for the same data:
> 
> real  1m16.540s
> user  1m14.849s
> sys   0m0.664s
> 
> And there is almost no significant performance boost by compiling it:
> 
> real  0m1.810s
> user  0m1.664s
> sys   0m0.140s
> 
> So the questions are:
> 
> - What is wrong with the Chicken code?
> - How can I profile the code?
> - Why is there no difference between csi and csc?
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] losing 'shuffle' ?

2011-08-22 Thread Daishi Kato
At Mon, 22 Aug 2011 10:04:58 +0200 (CEST),
Felix wrote:
> 
> From: Peter Lane 
> Subject: [Chicken-users] losing 'shuffle' ?
> Date: Sun, 21 Aug 2011 11:29:16 +0100
> 
> > Hi,
> > 
> > I've started working with the development snapshot, 4.7.3, but see in the 
> > NEWS:
> > 
> >> "shuffle" has been deprecated
> > 
> > Is it being moved?  Or is there an alternative function?
> 
> It didn't think that anybody used it. Should it stay?

I used to use it.
What is your recommended workaround, if it's deprecated?

--daishi

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] http-client doesn't handle closed persistent connections

2011-01-31 Thread Daishi Kato
At Mon, 31 Jan 2011 20:24:46 +0100,
Peter Bex wrote:
> I've checked in a new version that first checks to see whether
> a char is ready before trying to peek.  There ought not to be
> a character ready in normal circumstances, so trying to read
> the EOF object only when there is should fix the situation.

Tried the trunk, working fine.
I don't see any problems now.
Thank you!

Best,
Daishi

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] http-client doesn't handle closed persistent connections

2011-01-31 Thread Daishi Kato
At Mon, 31 Jan 2011 13:14:34 +0100,
Peter Bex wrote:
> 
> On Mon, Jan 31, 2011 at 09:10:14PM +0900, Daishi Kato wrote:
> > Hm, it avoids the problem, which is good.
> > However, it now doesn't keep connections.
> > In the case of www.apache.org, if you call http requests
> > twice in 5sec, the connection should be reused.
> > This was working with the released egg, but
> > it doesn't work with the trunk, which means
> > it creates a new connection even within 5sec.
> 
> Crap, you're right. I have no idea how to fix this properly right now
> though.  I'll need to think about it some more.

How about raising an i/o exception(condition) when
it detects #!eof in read-response in intarweb.scm?
It will retry.

Best,
Daishi

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] http-client doesn't handle closed persistent connections

2011-01-31 Thread Daishi Kato
At Sun, 30 Jan 2011 14:12:36 +0100,
Peter Bex wrote:
> 
> On Sun, Jan 30, 2011 at 09:57:47PM +0900, Daishi Kato wrote:
> > > A test case would be welcome.
> > 
> > Here is how to reproduce the problem.
> > 
> > #;2> (string-length (with-input-from-request "http://www.apache.org/"; #f 
> > read-string))
> > 44138
> > 
> > This apache server is probably configured to keep connections for 5sec.
> > The unofficial keep-alive header says so.
> > I could confirm that the connection is closed after 5sec by netstat.
> 
> Excellent!  Thank you for this test case.  It appears to be very simple;
> when the remote end drops the connection, the input port is _not_
> automatically closed.  Reading from it returns #!eof though, so I now
> added a peek-char call to the connection status check, which seems to
> fix the problem.
> 
> Could you (and Thomas, too) try http-client trunk and let me know if
> everything is working out now?  I'll make a new release if it works now.

Hm, it avoids the problem, which is good.
However, it now doesn't keep connections.
In the case of www.apache.org, if you call http requests
twice in 5sec, the connection should be reused.
This was working with the released egg, but
it doesn't work with the trunk, which means
it creates a new connection even within 5sec.

Best,
Daishi

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] http-client doesn't handle closed persistent connections

2011-01-30 Thread Daishi Kato
At Sat, 29 Jan 2011 16:04:26 +0100,
Peter Bex wrote:
> 
> On Sat, Jan 29, 2011 at 11:57:27PM +0900, Daishi Kato wrote:
> > After a quick look in the code, one suspect is that port-closed?
> > can't check a closed port, but not really sure.
> 
> If that's the case, it's a bug in Chicken because http-client simply
> used the definition from library.scm, and provides its own copy if we're
> on an older Chicken that doesn't provide this procedure.
> 
> > Or, it doesn't raise an exception when it detects closed connection.
> > I'll work more tomorrow and try to make a test case,
> > but let me know if you already know this issue.
> 
> I have observed "weird' behaviours on closed connections before,
> but always in error cases only, and I wasn't able to debug that,
> so I'm not sure if that's the same issue you're reporting.
> 
> A test case would be welcome.

Here is how to reproduce the problem.

CHICKEN
(c)2008-2010 The Chicken Team
(c)2000-2007 Felix L. Winkelmann
Version 4.6.0
linux-unix-gnu-x86 [ manyargs dload ptables ]
compiled 2011-01-11 on spirits (Linux)

#;1> (use http-client)
#;2> (string-length (with-input-from-request "http://www.apache.org/"; #f 
read-string))
44138
#;3> (thread-sleep! 5)  
#;4> (string-length (with-input-from-request "http://www.apache.org/"; #f 
read-string))
2
#;5> (string-length (with-input-from-request "http://www.apache.org/"; #f 
read-string))
44138


This apache server is probably configured to keep connections for 5sec.
The unofficial keep-alive header says so.
I could confirm that the connection is closed after 5sec by netstat.

Best,
Daishi

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] http-client doesn't handle closed persistent connections

2011-01-30 Thread Daishi Kato
At Sat, 29 Jan 2011 11:03:42 -0500,
Thomas Hintz wrote:
> 
> I also have experienced weird behavior related to connections.
> 
> On my system, about 85% of the time, the second usage of
> with-input-from-request results in the call failing. In my web app, which
> utilizes http-client to make REST calls, I've been putting mutexes around my
> http-client code and closing the connections after every call. This always
> works, but not closing the connection after every call, nearly always fails.
> 
> I could give you a specific test case, but on my development box, it pretty
> much always fails for every second usage of with-input-from-request.

Yes, exactly the same case.

Best,
Daishi

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] http-client doesn't handle closed persistent connections

2011-01-29 Thread Daishi Kato
Hi Peter,

I just found that the http-client can't handle closed
persistent connections very well, at least in my case.
Looks like this happens both in 3.2.0 and 4.6.0,
so porting is not an issue in this case.

After a quick look in the code, one suspect is that port-closed?
can't check a closed port, but not really sure.
Or, it doesn't raise an exception when it detects closed connection.
I'll work more tomorrow and try to make a test case,
but let me know if you already know this issue.

Best,
Daishi

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Need help on sxpath/txpath

2011-01-29 Thread Daishi Kato
At Sat, 29 Jan 2011 13:46:20 +0100,
Peter Bex wrote:
> 
> On Sat, Jan 29, 2011 at 09:32:10PM +0900, Daishi Kato wrote:
> > And, found it! Yes, Peter.
> > 
> > In release/3/sxml-tools/extras/string-utils.scm,
> > (define (substring? pattern str) (string-contains str pattern))
> > 
> > However, in release/4/sxpath/trunk/chicken/[st]xpath.scm,
> > (define substring? string-contains)
> > which is obviously incorrect.
> 
> D'oh!  I messed up :)
> 
> > Could you fix this please?
> 
> Done.

Thanks for the immediate fix, Peter.
This solves everything that I encountered,
and there's no bugs at the moment.

Best,
Daishi

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Need help on sxpath/txpath

2011-01-29 Thread Daishi Kato
At Fri, 28 Jan 2011 16:45:06 +0100,
Peter Bex wrote:
> I suck at xpath so I have no idea.  You could try the SSAX mailinglist...

Before trying the ssax ML, I looked the code again.
Because I didn't find big difference in ssax code,
I assumed this is a chicken-specific bug.

And, found it! Yes, Peter.

In release/3/sxml-tools/extras/string-utils.scm,
(define (substring? pattern str) (string-contains str pattern))

However, in release/4/sxpath/trunk/chicken/[st]xpath.scm,
(define substring? string-contains)
which is obviously incorrect.

Could you fix this please?

I might find another bug, but I'll wait your fix
and double check it.

Thanks for your help, even if you suck at xpath.

Best,
Daishi

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Need help on sxpath/txpath

2011-01-28 Thread Daishi Kato
At Fri, 28 Jan 2011 15:34:09 +0100,
Peter Bex wrote:
> 
> On Fri, Jan 28, 2011 at 11:27:26PM +0900, Daishi Kato wrote:
> > Hi,
> > 
> > I digged into the problem a little more and found something.
> > 
> > In 4.6.0, this is somewhat working:
> > #;24> ((sxpath "//table/tr[td[a[contains(href,'&abc=123&')]]]") 
> > (html->sxml " > href=\"/xxx/yyy/?zzz&abc=123&\">yyy"))
> > ((tr (td (a (@ (href "/xxx/yyy/?zzz&abc=123&")) "yyy"
> > 
> > So, I replaced @href with href.
> > Is it correct? Maybe not.
> > I assume the sxpath egg is incorrect.
> > 
> > Can anybody tell if this is a chicken-specific problem, or
> > of sxml-tools at sourceforge?
> 
> It probably is not a chicken-specific problem because the sxpath
> egg includes an unmodified copy of SSAX.

Looked at:
diff -rw release/3/sxml-tools/sxml-tools/ release/4/sxpath/trunk/sxml-tools/

but, I'm not sure is there's such a big difference.
Furthermode, it's hardly understandable that the newer version is incorrect.

I don't know what to do... Confirm if it's really a bug against XPath spec?

Best,
Daishi


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Need help on sxpath/txpath

2011-01-28 Thread Daishi Kato
Hi,

I digged into the problem a little more and found something.

In 4.6.0, this is somewhat working:
#;24> ((sxpath "//table/tr[td[a[contains(href,'&abc=123&')]]]") 
(html->sxml "yyy"))
((tr (td (a (@ (href "/xxx/yyy/?zzz&abc=123&")) "yyy"

So, I replaced @href with href.
Is it correct? Maybe not.
I assume the sxpath egg is incorrect.

Can anybody tell if this is a chicken-specific problem, or
of sxml-tools at sourceforge?

Best,
Daishi

At Sun, 16 Jan 2011 22:32:23 +0900,
Daishi Kato wrote:
> 
> Here you go. --daishi
> 
> CHICKEN
> (c)2008-2010 The Chicken Team
> (c)2000-2007 Felix L. Winkelmann
> Version 4.6.0
> linux-unix-gnu-x86 [ manyargs dload ptables ]
> compiled 2011-01-11 on spirits (Linux)
> 
> #;1> (use sxpath htmlprag utils)
> ; loading /usr/local/chicken-4.6.0/lib/chicken/5/sxpath.import.so ...
> ; loading /usr/local/chicken-4.6.0/lib/chicken/5/chicken.import.so ...
> ; loading /usr/local/chicken-4.6.0/lib/chicken/5/scheme.import.so ...
> ; loading /usr/local/chicken-4.6.0/lib/chicken/5/data-structures.import.so ...
> ; loading /usr/local/chicken-4.6.0/lib/chicken/5/srfi-1.import.so ...
> ; loading /usr/local/chicken-4.6.0/lib/chicken/5/srfi-13.import.so ...
> ; loading /usr/local/chicken-4.6.0/lib/chicken/5/sxpath-lolevel.import.so ...
> ; loading /usr/local/chicken-4.6.0/lib/chicken/5/extras.import.so ...
> ; loading /usr/local/chicken-4.6.0/lib/chicken/5/ports.import.so ...
> ; loading /usr/local/chicken-4.6.0/lib/chicken/5/txpath.import.so ...
> ; loading /usr/local/chicken-4.6.0/lib/chicken/5/htmlprag.import.so ...
> ; loading /usr/local/chicken-4.6.0/lib/chicken/5/sxpath.so ...
> ; loading /usr/local/chicken-4.6.0/lib/chicken/5/sxpath-lolevel.so ...
> ; loading /usr/local/chicken-4.6.0/lib/chicken/5/txpath.so ...
> ; loading /usr/local/chicken-4.6.0/lib/chicken/5/htmlprag.so ...
> ; loading library utils ...
> #;2> ((sxpath "//table/tr[td[a[contains(@href,'&abc=123&')]]]") 
> (html->sxml " href=\"/xxx/yyy/?zzz&abc=123&\">yyy"))
> ()
> #;3>
> 
> 
> CHICKEN
> (c)2008 The Chicken Team
> (c)2000-2007 Felix L. Winkelmann
> Version 3.2.0 - linux-unix-gnu-x86  [ manyargs dload ptables applyhook ]
> SVN rev. 10664  compiled 2008-05-28 on spirits (Linux)
> 
> #;1> (use sxml-tools htmlprag utils)
> ; loading /usr/local/chicken-3.2.0/lib/chicken/3/sxml-tools.so ...
> ; loading /usr/local/chicken-3.2.0/lib/chicken/3/htmlprag.so ...
> ; loading library utils ...
> #;2> ((sxpath "//table/tr[td[a[contains(@href,'&abc=123&')]]]") 
> (html->sxml " href=\"/xxx/yyy/?zzz&abc=123&\">yyy"))
> ((tr (td (a (@ (href "/xxx/yyy/?zzz&abc=123&")) "yyy"
> #;3>
> 
> 
> At Sun, 16 Jan 2011 13:27:41 +0100,
> Peter Bex wrote:
> > 
> > On Sun, Jan 16, 2011 at 03:49:41PM +0900, Daishi Kato wrote:
> > > Hi,
> > > 
> > > I'm porting one of my projects from chicken-3.2.0 to chicken-4.6.0.
> > > (And thus found a bug in http-client.)
> > > 
> > > It seems like the previous sxpath doesn't work on the new one.
> > > Could anybody help how I can fix this?
> > > 
> > > The sxpath worked on chicken-3.2.0 is something like the following:
> > > 
> > > ((sxpath "//table/tr[td[a[contains(@href,'&abc=123&')]]]") x)
> > > 
> > > On 3.2.0 I used the sxml-tools egg and the sxpath egg on 4.6.0
> > 
> > What is the error you get?  What is the content you run this
> > expression on?  Can you simplify it to a simple testcase?
> > 
> > My gut feeling is that the & is maybe wrong.  Did you try just '&'?
> > 
> > Cheers,
> > Peter
> > -- 
> > http://sjamaan.ath.cx
> > --
> > "The process of preparing programs for a digital computer
> >  is especially attractive, not only because it can be economically
> >  and scientifically rewarding, but also because it can be an aesthetic
> >  experience much like composing poetry or music."
> > -- Donald Knuth
> > 
> > ___
> > Chicken-users mailing list
> > Chicken-users@nongnu.org
> > http://lists.nongnu.org/mailman/listinfo/chicken-users
> > 
> > **
> >  XREA.COM -Free Web Hosting-
> >  http://www.xrea.com/
> > **

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Need help on sxpath/txpath

2011-01-16 Thread Daishi Kato
Here you go. --daishi

CHICKEN
(c)2008-2010 The Chicken Team
(c)2000-2007 Felix L. Winkelmann
Version 4.6.0
linux-unix-gnu-x86 [ manyargs dload ptables ]
compiled 2011-01-11 on spirits (Linux)

#;1> (use sxpath htmlprag utils)
; loading /usr/local/chicken-4.6.0/lib/chicken/5/sxpath.import.so ...
; loading /usr/local/chicken-4.6.0/lib/chicken/5/chicken.import.so ...
; loading /usr/local/chicken-4.6.0/lib/chicken/5/scheme.import.so ...
; loading /usr/local/chicken-4.6.0/lib/chicken/5/data-structures.import.so ...
; loading /usr/local/chicken-4.6.0/lib/chicken/5/srfi-1.import.so ...
; loading /usr/local/chicken-4.6.0/lib/chicken/5/srfi-13.import.so ...
; loading /usr/local/chicken-4.6.0/lib/chicken/5/sxpath-lolevel.import.so ...
; loading /usr/local/chicken-4.6.0/lib/chicken/5/extras.import.so ...
; loading /usr/local/chicken-4.6.0/lib/chicken/5/ports.import.so ...
; loading /usr/local/chicken-4.6.0/lib/chicken/5/txpath.import.so ...
; loading /usr/local/chicken-4.6.0/lib/chicken/5/htmlprag.import.so ...
; loading /usr/local/chicken-4.6.0/lib/chicken/5/sxpath.so ...
; loading /usr/local/chicken-4.6.0/lib/chicken/5/sxpath-lolevel.so ...
; loading /usr/local/chicken-4.6.0/lib/chicken/5/txpath.so ...
; loading /usr/local/chicken-4.6.0/lib/chicken/5/htmlprag.so ...
; loading library utils ...
#;2> ((sxpath "//table/tr[td[a[contains(@href,'&abc=123&')]]]") 
(html->sxml "yyy"))
()
#;3>


CHICKEN
(c)2008 The Chicken Team
(c)2000-2007 Felix L. Winkelmann
Version 3.2.0 - linux-unix-gnu-x86  [ manyargs dload ptables applyhook ]
SVN rev. 10664  compiled 2008-05-28 on spirits (Linux)

#;1> (use sxml-tools htmlprag utils)
; loading /usr/local/chicken-3.2.0/lib/chicken/3/sxml-tools.so ...
; loading /usr/local/chicken-3.2.0/lib/chicken/3/htmlprag.so ...
; loading library utils ...
#;2> ((sxpath "//table/tr[td[a[contains(@href,'&abc=123&')]]]") 
(html->sxml "yyy"))
((tr (td (a (@ (href "/xxx/yyy/?zzz&abc=123&")) "yyy"
#;3>


At Sun, 16 Jan 2011 13:27:41 +0100,
Peter Bex wrote:
> 
> On Sun, Jan 16, 2011 at 03:49:41PM +0900, Daishi Kato wrote:
> > Hi,
> > 
> > I'm porting one of my projects from chicken-3.2.0 to chicken-4.6.0.
> > (And thus found a bug in http-client.)
> > 
> > It seems like the previous sxpath doesn't work on the new one.
> > Could anybody help how I can fix this?
> > 
> > The sxpath worked on chicken-3.2.0 is something like the following:
> > 
> > ((sxpath "//table/tr[td[a[contains(@href,'&abc=123&')]]]") x)
> > 
> > On 3.2.0 I used the sxml-tools egg and the sxpath egg on 4.6.0
> 
> What is the error you get?  What is the content you run this
> expression on?  Can you simplify it to a simple testcase?
> 
> My gut feeling is that the & is maybe wrong.  Did you try just '&'?
> 
> Cheers,
> Peter
> -- 
> http://sjamaan.ath.cx
> --
> "The process of preparing programs for a digital computer
>  is especially attractive, not only because it can be economically
>  and scientifically rewarding, but also because it can be an aesthetic
>  experience much like composing poetry or music."
>   -- Donald Knuth
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/chicken-users
> 
> **
>  XREA.COM -Free Web Hosting-
>  http://www.xrea.com/
> **

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] Need help on sxpath/txpath

2011-01-15 Thread Daishi Kato
Hi,

I'm porting one of my projects from chicken-3.2.0 to chicken-4.6.0.
(And thus found a bug in http-client.)

It seems like the previous sxpath doesn't work on the new one.
Could anybody help how I can fix this?

The sxpath worked on chicken-3.2.0 is something like the following:

((sxpath "//table/tr[td[a[contains(@href,'&abc=123&')]]]") x)

On 3.2.0 I used the sxml-tools egg and the sxpath egg on 4.6.0

Best,
Daishi

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] http-client and set-cookie

2011-01-15 Thread Daishi Kato
At Thu, 13 Jan 2011 21:19:08 +0100,
Peter Bex wrote:
> > It gives me:
> > Error: bad argument type - not a structure of the required type
> > (/ "xxx" "")
> > URI-common
> > 
> > It seems like it fails in path-match? in process-set-cookie!.
> 
> I think I see what you mean. I don't have any URL that responds in
> a way that triggers the bug for me, though :(
> 
> > I'm not totally sure, but could it be something like this?
> 
> Have you tested this patch?  Does it work for you?

No, because I didn't look into the code in detail.

> It seems wrong to me, since the set-cookie-parser parses path components
> into relative references (ie, uri-common objects).
> 
> Could you test this patch instead?

It worked. Thanks so much.

So, (get-param 'path c) actually returns a uri-common object. I see.

Best,
Daishi

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] http-client and set-cookie

2011-01-13 Thread Daishi Kato
Hi Peter,

I found a similar problem with my simple POST request using:
(define (post-page url args)
  (call-with-values
(lambda ()
  (with-input-from-request
   (make-request method: 'POST
 headers: (headers (list (list 'user-agent useragent)))
 uri: (uri-reference url))
   args read-string))
(lambda (x _ _) x)))

It gives me:
Error: bad argument type - not a structure of the required type
(/ "xxx" "")
URI-common

It seems like it fails in path-match? in process-set-cookie!.
I'm not totally sure, but could it be something like this?

  (define (path-match? uri path)
(and (uri-path-absolute? uri)
-(let loop ((path (cdr (uri-path path)))
+(let loop ((path (cdr path))
(uri-path (cdr (uri-path uri
   (or (null? path)   ; done
   (and (not (null? uri-path))
(or (and (string-null? (car path)) (null? (cdr path)))
  
(and (string=? (car path) (car uri-path))
 (loop (cdr path) (cdr uri-path)

Best,
Daishi

At Sun, 26 Dec 2010 00:29:54 +0100,
Peter Bex wrote:
> On Sat, Dec 25, 2010 at 08:04:33PM -0300, Hugo Arregui wrote:
> > Hi guys,
> > 
> > I localized the problem, the request header contains:  (set-cookie
> > #(("blogger_TID" . "XXX") ((httponly . #t
> > and in http-client.scm:299 (process-set-cookie! proc), (get-param
> > 'path c) returns #f
> > 
> > I just check for #f first, and works fine.
> > 
> > Now, my questions:
> > 
> > -it's a bug? I really don't understand what get-param is.
> 
> It's a bug.  Path is an optional parameter for the set-cookie header.
> get-param simply extracts that parameter from the header.  It looks like
> I added code to default to the current URI's path, but I forgot to
> actually use the derived path.
> 
> Please try the attached patch and let me know if it helps.
> 
> > -It's was hard to find the problem because the stack wasn't helpful, i
> > have to debug by hand, adding prints on egg source and that kind of
> > things. Is there a better way to do that?
> 
> The debug output is helpful, if you realize it's a continuation call
> trace rather than a traditional "call stack".  I often find the default
> length is a little short though.  You can increase that with -:aN where
> N is the desired length.  I usually just pass -:a100 or something and
> scroll through it.
> 
> Cheers,
> Peter
> -- 
> http://sjamaan.ath.cx
> --
> "The process of preparing programs for a digital computer
>  is especially attractive, not only because it can be economically
>  and scientifically rewarding, but also because it can be an aesthetic
>  experience much like composing poetry or music."


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] New eggs: npdiff, format-textdiff

2010-12-10 Thread Daishi Kato
It works, now. Thanks a lot.

So, does it support the unified diff? No docs found on the wiki.
I prefer the unified diff to the context diff.

Best,
Daishi

At Thu, 09 Dec 2010 23:42:22 +0900,
Ivan Raikov wrote:
> 
> 
> Hi Daishi,
> 
>Thanks for catching another important bug. I must admit that when I
> set out to write format-textdiff, the documentation for context and
> unified diffs was quite lacking, so I made a few guesses about how
> merging of diffs in the context format works. I have made significant
> improvements to the context diff code in format-textdiff. You will need
> to upgrade both npdiff and format-textdiff to try it out. Thanks again,
> 
>   -Ivan
> 
> Daishi Kato  writes:
> 
> > Hi Ivan,
> >
> > Here'a another bug:
> > (totally unsure what's going on).
> >
> > #;15> ((make-format-textdiff 'context) (current-output-port)(textdiff 
> > (with-input-from-string "\n\nAlthough there's basically no entry 
> > point,\nhere is some useful pointers.\n\n\n > href=\"100share/filer/base/filer.html\">Filer (without 
> > login)\nFiler 
> > (with login)\n > href=\"100share/waitlesql/base/waitlesql_query.html\">WaitleSQL\n\n\nHave
> >  fun!!!\n\n\n\n\n" read-lines) (with-input-from-string 
> > "\n\nAlthough there's basically no entry point,\nhere is some useful 
> > pointers.\n\n\n > href=\"AUTH/100share/filer/base/filer.html\">Filer (with 
> > login)\nFiler 
> > (without login)\n\n\nHave fun!!!\n\n\n\n" 
> > read-lines) 3) "old" "NO DATE" "new" "NO DATE")
> > *** old NO DATE
> > --- new NO DATE
> 
> **
>  XREA.COM -Free Web Hosting-
>  http://www.xrea.com/
> **

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] New eggs: npdiff, format-textdiff

2010-12-07 Thread Daishi Kato
Hi Ivan,

Here'a another bug:
(totally unsure what's going on).

#;15> ((make-format-textdiff 'context) (current-output-port)(textdiff 
(with-input-from-string "\n\nAlthough there's basically no entry point,\nhere 
is some useful pointers.\n\n\nFiler (without login)\nFiler (with 
login)\nWaitleSQL\n\n\nHave
 fun!!!\n\n\n\n\n" read-lines) (with-input-from-string 
"\n\nAlthough there's basically no entry point,\nhere is some useful 
pointers.\n\n\nFiler 
(with login)\nFiler 
(without login)\n\n\nHave fun!!!\n\n\n\n" 
read-lines) 3) "old" "NO DATE" "new" "NO DATE")
*** old NO DATE
--- new NO DATE

Error: (car) bad argument type: #f

Call history:

vector-lib#vectors-ref
loop2+806
vector-lib#vectors-ref
loop2+806
vector-lib#vectors-ref
vector-lib#%smallest-length
min
loop248
loop2+806
vector-lib#vectors-ref  <--



Best,
Daishi

At Thu, 02 Dec 2010 15:48:05 +0900,
Ivan Raikov wrote:
> 
> 
> Hi Daishi,
> 
>  Thanks for all your feedback and testing of boundary cases :-) The
> problem below was actually caused by npdiff, which has been fixed, and I
> also uncovered some additional problems in format-textdiff, which also
> have been fixed. Please upgrade both npdiff and format-textdiff, and let
> me know if they work for you. Thanks,
> 
>   -Ivan
> 
> Daishi Kato  writes:
> 
> > Hi Ivan,
> >
> > I think this is a bug in textdiff,
> > since it could happen with the example shown in
> > http://wiki.call-cc.org/eggref/4/format-textdiff,
> > with empty files.
> >
> > #;2> (textdiff (with-input-from-string "" read-lines) 
> > (with-input-from-string "abc\n" read-lines) 3)
> >
> > Error: (vector-copy) vector index too high
> > (index 0)
> > (vector #())
> >
> > Call history:
> >
> > list->vector  
> > list->vector  
> > ##sys#call-with-values
> > vector-lib#check-index
> > values
> > make-vector   
> > vector->list  
> > ##sys#call-with-values
> > vector-lib#check-index
> > ##sys#error <--
> >
> >
> > Can you easily fix this?
> >
> > Best,
> > Daishi
> >
> > At Thu, 25 Nov 2010 15:16:22 +0900,
> > Daishi Kato wrote:
> >> 
> >> Hi Ivan,
> >> 
> >> It works now.
> >> Thanks!
> >> 
> >> One very small request: "diff --unified" format.
> >> 
> >> Best,
> >> Daishi
> >> 
> >> At Fri, 19 Nov 2010 13:42:20 +0900,
> >> Ivan Raikov wrote:
> >> > 
> >> > 
> >> > Hello,
> >> > 
> >> >   Thanks for trying to use format-textdiff. The problem below was
> >> > actually caused by a bug in npdiff, which has been fixed in npdiff
> >> > release 1.13. Please update your copy of npdiff and try again. Let me
> >> > know if you encounter  any other issues with those eggs.
> >> > 
> >> >   -Ivan
> >> > 
> >> > Daishi Kato  writes:
> >> > 
> >> > > Hi all,
> >> > >
> >> > > Anybody using format-textdiff?
> >> > >
> >> > > I encountered the following problem:
> >> > > CHICKEN
> >> > > (c)2008-2010 The Chicken Team
> >> > > (c)2000-2007 Felix L. Winkelmann
> >> > > Version 4.6.1
> >> > > linux-unix-gnu-x86 [ manyargs dload ptables ]
> >> > > compiled 2010-09-25 on lobule (Linux)
> >> > >
> >> > > #;1> (use format-textdiff)
> >> > > #;2> (textdiff (with-input-from-string "abc\n" read-lines) 
> >> > > (with-input-from-string "def\n" read-lines))
> >> > >
> >> > > Error: bad argument count - received 4 but expected 6: #
> >> > >
> >> > > Call history:
> >> > >
> >> > > ##sys#call-with-values
> >> > > vector-lib#check-index
> >> > > values
> >> > > make-vector
> >> > > vector->list
> >> > > ##sys#call-with-values
> >> > > vector-lib#check-index
> >> > > values
> >> > > make-vector
> >> > > vector->list<--
> >> > 
> >> > **
> >> >  XREA.COM -Free Web Hosting-
> >> >  http://www.xrea.com/
> >> > **

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] New eggs: npdiff, format-textdiff

2010-11-29 Thread Daishi Kato
Hi Ivan,

I think this is a bug in textdiff,
since it could happen with the example shown in
http://wiki.call-cc.org/eggref/4/format-textdiff,
with empty files.

#;2> (textdiff (with-input-from-string "" read-lines) (with-input-from-string 
"abc\n" read-lines) 3)

Error: (vector-copy) vector index too high
(index 0)
(vector #())

Call history:

list->vector  
list->vector  
##sys#call-with-values
vector-lib#check-index
values
make-vector   
vector->list  
##sys#call-with-values
vector-lib#check-index
##sys#error <--


Can you easily fix this?

Best,
Daishi

At Thu, 25 Nov 2010 15:16:22 +0900,
Daishi Kato wrote:
> 
> Hi Ivan,
> 
> It works now.
> Thanks!
> 
> One very small request: "diff --unified" format.
> 
> Best,
> Daishi
> 
> At Fri, 19 Nov 2010 13:42:20 +0900,
> Ivan Raikov wrote:
> > 
> > 
> > Hello,
> > 
> >   Thanks for trying to use format-textdiff. The problem below was
> > actually caused by a bug in npdiff, which has been fixed in npdiff
> > release 1.13. Please update your copy of npdiff and try again. Let me
> > know if you encounter  any other issues with those eggs.
> > 
> >   -Ivan
> > 
> > Daishi Kato  writes:
> > 
> > > Hi all,
> > >
> > > Anybody using format-textdiff?
> > >
> > > I encountered the following problem:
> > > CHICKEN
> > > (c)2008-2010 The Chicken Team
> > > (c)2000-2007 Felix L. Winkelmann
> > > Version 4.6.1
> > > linux-unix-gnu-x86 [ manyargs dload ptables ]
> > > compiled 2010-09-25 on lobule (Linux)
> > >
> > > #;1> (use format-textdiff)
> > > #;2> (textdiff (with-input-from-string "abc\n" read-lines) 
> > > (with-input-from-string "def\n" read-lines))
> > >
> > > Error: bad argument count - received 4 but expected 6: #
> > >
> > > Call history:
> > >
> > > ##sys#call-with-values
> > > vector-lib#check-index
> > > values
> > > make-vector
> > > vector->list
> > > ##sys#call-with-values
> > > vector-lib#check-index
> > > values
> > > make-vector
> > > vector->list<--
> > 
> > **
> >  XREA.COM -Free Web Hosting-
> >  http://www.xrea.com/
> > **

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] csv egg

2010-11-29 Thread Daishi Kato
Ivan,

Thank you for the quick fix!
It now works.

Best,
Daishi

At Mon, 29 Nov 2010 16:37:03 +0900,
Ivan Raikov wrote:
> 
> 
> Hello, Daishi,
> 
>csv was not detecting special characters due to recent changes in the
> Chicken regex API. I have updated csv so that escaping of cell content
> works properly. You should now be able to do:
> 
> csi> (use csv)
> csi> (define-values (format-csv-cell format-csv-record format-csv) 
> (make-format #\,))
> csi> (format-csv-record (list->csv-record (list "a,b,c" "d" "e")))
> "\"a,b,c\",d,e"
> 
> 
> Daishi Kato  writes:
> 
> > Hi,
> >
> > I'm trying to use the csv egg.
> > http://wiki.call-cc.org/eggref/4/csv
> >
> > I was not sure how I can format data like
> > "a,b,c",d,e
> > meaning a cell that contains comma, newline, and so on.
> >
> > Isn't it supported?
> >
> > Best,
> > Daishi
> 
> **
>  XREA.COM -Free Web Hosting-
>  http://www.xrea.com/
> **

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] csv egg

2010-11-28 Thread Daishi Kato
Hi,

I'm trying to use the csv egg.
http://wiki.call-cc.org/eggref/4/csv

I was not sure how I can format data like
"a,b,c",d,e
meaning a cell that contains comma, newline, and so on.

Isn't it supported?

Best,
Daishi

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] New eggs: npdiff, format-textdiff

2010-11-24 Thread Daishi Kato
Hi Ivan,

It works now.
Thanks!

One very small request: "diff --unified" format.

Best,
Daishi

At Fri, 19 Nov 2010 13:42:20 +0900,
Ivan Raikov wrote:
> 
> 
> Hello,
> 
>   Thanks for trying to use format-textdiff. The problem below was
> actually caused by a bug in npdiff, which has been fixed in npdiff
> release 1.13. Please update your copy of npdiff and try again. Let me
> know if you encounter  any other issues with those eggs.
> 
>   -Ivan
> 
> Daishi Kato  writes:
> 
> > Hi all,
> >
> > Anybody using format-textdiff?
> >
> > I encountered the following problem:
> > CHICKEN
> > (c)2008-2010 The Chicken Team
> > (c)2000-2007 Felix L. Winkelmann
> > Version 4.6.1
> > linux-unix-gnu-x86 [ manyargs dload ptables ]
> > compiled 2010-09-25 on lobule (Linux)
> >
> > #;1> (use format-textdiff)
> > #;2> (textdiff (with-input-from-string "abc\n" read-lines) 
> > (with-input-from-string "def\n" read-lines))
> >
> > Error: bad argument count - received 4 but expected 6: #
> >
> > Call history:
> >
> > ##sys#call-with-values
> > vector-lib#check-index
> > values
> > make-vector
> > vector->list
> > ##sys#call-with-values
> > vector-lib#check-index
> > values
> > make-vector
> > vector->list<--
> 
> **
>  XREA.COM -Free Web Hosting-
>  http://www.xrea.com/
> **

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] New eggs: npdiff, format-textdiff

2010-11-18 Thread Daishi Kato
Hi all,

Anybody using format-textdiff?

I encountered the following problem:
CHICKEN
(c)2008-2010 The Chicken Team
(c)2000-2007 Felix L. Winkelmann
Version 4.6.1
linux-unix-gnu-x86 [ manyargs dload ptables ]
compiled 2010-09-25 on lobule (Linux)

#;1> (use format-textdiff)
#;2> (textdiff (with-input-from-string "abc\n" read-lines) 
(with-input-from-string "def\n" read-lines))

Error: bad argument count - received 4 but expected 6: #

Call history:

##sys#call-with-values
vector-lib#check-index
values
make-vector
vector->list
##sys#call-with-values
vector-lib#check-index
values
make-vector
vector->list<--


Any help appreciated.

Best,
Daishi

At Fri, 08 Jun 2007 16:03:47 +0900,
Ivan Raikov wrote:
> 
> 
> Greetings,
> 
>   I have uploaded two new eggs:
> 
>* npdiff -- an implementation of an O(NP) longest common substring
>  algorithm, for a sequence of arbitrary type
> 
>  http://www.call-with-current-continuation.org/eggs/npdiff.html
> 
> 
>* format-textdiff -- using the npdiff library, defines a diff
>  function for arrays of strings, and provides some of the hunk
>  output formats supported by the Unix diff(1) command. 
> 
>  http://www.call-with-current-continuation.org/eggs/format-textdiff.html
> 
> 
>   -Ivan
> 
> 
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/chicken-users
> 
> **
>  XREA.COM -Free Web Hosting-
>  http://www.xrea.com/
> **

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Proxy support for http-client [Was: Re: I'm starting using chicken4]

2010-11-02 Thread Daishi Kato
At Sat, 9 Oct 2010 22:05:20 +0200,
Peter Bex wrote:
> 
> On Wed, Sep 29, 2010 at 12:25:52AM +0900, Daishi Kato wrote:
> > Porting my code from chicken3/http-client to chicken4/http-client
> > was fairly easy, except that I have to give up the proxy support.
> > So, Peter, my huge request is the proxy support.
> 
> This has been added to trunk http-client and should be available for
> chicken-install shortly.
> 
> I've only tested this with a simple Squid deployment and it seems to
> work well enough.  More testing would be appreciated!

Tested with my environment. (the same squid, though.)
It worked as expected. (http_proxy,no_proxy env.)

Thanks!

Best,
Daishi

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: static linking (Re: [Chicken-users] wish-list

2010-11-01 Thread Daishi Kato
At Sun, 31 Oct 2010 23:55:05 +0100 (CET),
Felix wrote:
> 
> From: Daishi Kato 
> Subject: Re: static linking (Re: [Chicken-users] wish-list
> Date: Fri, 29 Oct 2010 22:51:43 +0900
> 
> > At Fri, 29 Oct 2010 04:46:34 -0400 (EDT),
> > Felix wrote:
> >> Uh - that's a lot. Some of them can be easily converted, some are 
> >> compile-time
> >> only, but some others are more subtle. Do you need all those in a single 
> >> application?
> > 
> > More precisely, here's the list of eggs that I (use in a single app.
> >  base64 environments files http-client http-server iconv intarweb
> >  json lolevel mailbox md5 mime posix regex rfc822 smtp spiffy spiffy-cookies
> >  srfi-1 srfi-13 srfi-14 srfi-18 srfi-4 srfi-69 ssax sxml-transforms sxpath
> >  uri-common uri-generic utf8-lolevel utils
> 
> Some of those are core libraries that are linked statically with
> libchicken.a, and the others should be convertible to allow static
> linking. There might be a problem with indirect extension requirements
> (see also ticket #420 on bugs.call-cc.org), but that can be
> solved. Actually chicken recently (since 4.6.0) got a
> `standard-extension' procedure that avoids the boilerplate in
> "standard" eggs (those that consist of a single file and provide a
> single module of the same name) and automatically compiles for static
> linking (to be used in .setup scripts). 
> 
> I will start adding static linking support to some of these.

Sounds great.
In the meantime, I will try -deploy.

Best,
Daishi

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: static linking (Re: [Chicken-users] wish-list

2010-10-29 Thread Daishi Kato
At Fri, 29 Oct 2010 16:09:42 +0200,
Peter Bex wrote:
> 
> On Fri, Oct 29, 2010 at 10:57:23PM +0900, Daishi Kato wrote:
> > Oh, this sounds something. Yes, I don't need to eliminate ld dependence.
> > I'm not sure if I understand the usage of -deploy.
> > 
> > csc:
> > -deploydeploy self-contained application bundle
> 
> Try http://wiki.call-cc.org/manual/Deployment

Thanks.
So, this is to place so files with the executables (and link).

I'm doing a workaround with CHICKEN_PREFIX.
(I looked for CHICKEN_REPOSITORY_PATH, which is no longer available.)

I do not need to compile w/ -static, but to link with *.o eggs,
isn't it possible?

--daishi

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: static linking (Re: [Chicken-users] wish-list

2010-10-29 Thread Daishi Kato
At Fri, 29 Oct 2010 04:48:14 -0400 (EDT),
Felix wrote:
> 
> From: Daishi Kato 
> Subject: static linking (Re: [Chicken-users] wish-list
> Date: Thu, 28 Oct 2010 01:04:27 +0900
> 
> Oh, and I forgot to mention that you can also use the `-deploy'
> option for `csc' and `chicken-install' - that might be a 
> simpler way to create a standalone application.

Oh, this sounds something. Yes, I don't need to eliminate ld dependence.
I'm not sure if I understand the usage of -deploy.

csc:
-deploydeploy self-contained application bundle

chicken-install:
   -deploy  build extensions for deployment

So, I can just re-install all eggs with -deploy.
and compile my app with -deploy, which produces
an executable which only depends libc and some standard libs?

Best,
Daishi

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: static linking (Re: [Chicken-users] wish-list

2010-10-29 Thread Daishi Kato
At Fri, 29 Oct 2010 04:46:34 -0400 (EDT),
Felix wrote:
> Uh - that's a lot. Some of them can be easily converted, some are compile-time
> only, but some others are more subtle. Do you need all those in a single 
> application?

More precisely, here's the list of eggs that I (use in a single app.
 base64 environments files http-client http-server iconv intarweb
 json lolevel mailbox md5 mime posix regex rfc822 smtp spiffy spiffy-cookies
 srfi-1 srfi-13 srfi-14 srfi-18 srfi-4 srfi-69 ssax sxml-transforms sxpath
 uri-common uri-generic utf8-lolevel utils

I installed these eggs and there are a lot of so files in lib.

Thanks.
Daishi

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: I'm starting using chicken4 (Re: [Chicken-users] 4.6.1 performance boost

2010-10-04 Thread Daishi Kato
It works fine. Thank you, Peter.
I didn't recognize this because I used mod_rewrite for reverse proxy.

Daishi

At Mon, 4 Oct 2010 16:44:37 +0200,
Peter Bex wrote:
> 
> On Mon, Oct 04, 2010 at 04:38:32PM +0200, Peter Bex wrote:
> > hm, perhaps this is a silly question (I don't know much about Apache),
> > but have you considered enabling ProxyPreserveHost?
> > http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypreservehost
> 
> Since the docs say this should be off usually, perhaps ProxyPassReverse
> is the "correct" way to do it:
> http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypassreverse
> 
> This Apache business confuses me no end.
> 
> Cheers,
> Peter
> -- 
> http://sjamaan.ath.cx
> --
> "The process of preparing programs for a digital computer
>  is especially attractive, not only because it can be economically
>  and scientifically rewarding, but also because it can be an aesthetic
>  experience much like composing poetry or music."
>   -- Donald Knuth
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/chicken-users
> 
> **
>  XREA.COM -Free Web Hosting-
>  http://www.xrea.com/
> **

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


FastCGI (Re: I'm starting using chicken4 (Re: [Chicken-users] 4.6.1 performance boost

2010-10-04 Thread Daishi Kato
At Mon, 4 Oct 2010 16:23:37 +0200,
Peter Bex wrote:
> > One solution would be to use SGI, which is not ready in chicken4.
> 
> Indeed. However, fastcgi is ready.  You'd need to drop Spiffy then, though.

Can anybody tell me about fastcgi?
As far as I understand, fastcgi create several processes.
Because my project heavily depends on the lightweight threads,
running several processes is not possible,
and I want one process keeps running. (I don't want Apache (or anything)
to kill the process.)
How is it compatible with fastcgi?

Thanks.
Daishi

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] how to handle http multipart/form-data

2010-10-04 Thread Daishi Kato
At Mon, 4 Oct 2010 12:20:14 +0200,
Peter Bex wrote:
> 
> On Mon, Oct 04, 2010 at 07:14:30PM +0900, Daishi Kato wrote:
> > At Fri, 1 Oct 2010 20:11:03 +0200,
> > Peter Bex wrote:
> > > 
> > > On Sat, Oct 02, 2010 at 12:28:45AM +0900, Daishi Kato wrote:
> > > > Dear Peter,
> > > > 
> > > > Another question regarding with chicken3->chicken4 porting.
> > > > I used the http-server-form-posts egg to handle multipart/form-data,
> > > > but the egg is not available (or not compatible) for chicken4.
> > > > 
> > > > How can I deal with mime multipart/form-data?
> > > 
> > > I'm afraid nobody has implemented this yet.
> > 
> > Hmm, too bad.
> > How does it make sense to port http-server-form-posts to chicken4?
> 
> If I recall correctly, that egg makes the big mistake of reading the
> entire post body into memory.  It's slightly better to write to temporary
> files and provide an API over that.

Yes, that's how it works in chicken3.
I agree that putting everything in memorfy isn't good,
but using temporary files doesn't sound nice.
I wish you find a way to make it port-based, or stream processing.

> It would probably be even better to provide an API that allows the user
> to define how to handle the incoming data, but that would require
> substantial thinking :)

In the meantime, I will hack http-server-form-posts for my own,
because form-data is a must in my project...

Best,
Daishi

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: I'm starting using chicken4 (Re: [Chicken-users] 4.6.1 performance boost

2010-10-04 Thread Daishi Kato
At Mon, 4 Oct 2010 15:24:10 +0200,
Peter Bex wrote:
> >  raw-handler.scm
> > ; handler to emulate chicken3-style request-handler
> 
> [..code snipped..]
> 
> I don't know, but that doesn't look complete.

> Yeah, that'd just be a simple wrapper layer around it.

It's incomplete. I just wanted to ask you if it's
something valuable to others.

> > I'm creating 302 response without specifying the host.
> 
> Sorry, that's not allowed (see RFC2616, 14.30).  I know, "everyone
> does it", but it's actually invalid.

Yeah, I think I've read that some time back.

> Anyway, why would you want to do that at all?  The current request URI
> is already absolute by default, and having the host in there doesn't
> hurt, does it?

I tell you why, and maybe you have an idea for workaround.
I've started my project with http-server (or spiffy) as a standalone
http server, however I now have to run on a server that runs Apache
and only port 80 is available. Hence, I let Apache forward http requests
to my standalone server (Reverse Proxy).
If I use the absolute path, it becomes something like
http://127.0.0.1:/.
which doesn't make sense.
One restriction is that I don't want to include the server hostname in scm.

One solution would be to use SGI, which is not ready in chicken4.

> I went through quite some trouble to get it working this way precisely
> because of the requirement in the RFC that the location should be
> absolute!  And now you're going through a lot of trouble to strip off
> that stuff, undoing my work.  I find that rather ironic :)

Because the rest of my code is old :)

> > wow. I wish you include those examples in the doc.
> 
> It's a wiki, you know :) But I've added it for you.

Ture. I'm not confident to give them nicely.

Best,
Daishi

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] how to handle http multipart/form-data

2010-10-04 Thread Daishi Kato
At Fri, 1 Oct 2010 20:11:03 +0200,
Peter Bex wrote:
> 
> On Sat, Oct 02, 2010 at 12:28:45AM +0900, Daishi Kato wrote:
> > Dear Peter,
> > 
> > Another question regarding with chicken3->chicken4 porting.
> > I used the http-server-form-posts egg to handle multipart/form-data,
> > but the egg is not available (or not compatible) for chicken4.
> > 
> > How can I deal with mime multipart/form-data?
> 
> I'm afraid nobody has implemented this yet.

Hmm, too bad.
How does it make sense to port http-server-form-posts to chicken4?

Best,
Daishi

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: I'm starting using chicken4 (Re: [Chicken-users] 4.6.1 performance boost

2010-10-04 Thread Daishi Kato
At Fri, 1 Oct 2010 20:10:36 +0200,
Peter Bex wrote:
> 
> On Sat, Oct 02, 2010 at 12:22:22AM +0900, Daishi Kato wrote:
> > > Yes, this is uglier.  There are several different request handling
> > > eggs now though!  They make it easier to handle incoming requests.
> > 
> > Is it that ugly?
> > None of the request handling eggs in the spiffy manual
> > was not so low level.
> 
> I'm confused; do you think the eggs are lower-level than your code, or
> do you think the spiffy code itself is low-level, or what?

OK, I meant:
a) chicken3/http-server was low level so that I can write my handler.
b) chicken3/spiffy was not low level.
c) chicken4/spiffy is low level enough to port my code thanks to vhost support.

> > I don't understand the discussion here. How felix isn't happy?
> 
> He's unhappy that the way to define request handlers has become so
> much more complicated.

I see.

> > I thought the vhost support is very powerful.
> 
> It is, but it comes at the price of not being able to simply define
> request handlers at the global path level, since those would apply
> to all vhosts.

I'm not so motivated since I'm already moved to chicken4,
but I'm happy to contribute to the community, so let me try writing it.

 raw-handler.scm
; handler to emulate chicken3-style request-handler

(define (raw-handler fn)
  (let* ([req (current-request)]
 [m (request-method req)]
 [a (assq m request-method-handlers)])
((cdr a) req)))
  ;; how can it handle errors?

(define request-method-handlers '())

(define (http:request-method-handler m . h)
  (let ([a (assq m request-method-handlers)])
(if (pair? h)
(if a 
(set-cdr! a (car h))
(set! request-method-handlers (alist-cons m (car h) 
request-method-handlers)) )
(and a (cdr a)) ) ) )


However, this is not compatible with chicken3/http-server,
because of the structure of req, which is port-based instead of string-based.
If it is required, we could make it really compatible.
 
> > > > There were many tiny things for porting my code, such as dealing
> > > > with the fancy uri-common egg and string-match -> string-search.
> > > 
> > > Are you using "fancy" in a good way or in a bad way?  I'm really eager
> > > to hear how these new http libraries are being used and how people like
> > > them, so I can improve where things are not as smooth as they should be.
> > 
> > Good question. I used "fancy" in a good way, but if you ask me:
> > it might be too premitive, or there are too many procedures to understand.
> 
> URI-common exports 30 identifiers, I guess you could call that a lot :)
> However, most of those are simply record accessors and constructors.
> There are a bunch of predicates and conversion procedures which are
> sorely needed.
> 
> If you have more specific questions about the various procedures, feel
> free to ask them.  Maybe you can help me out improving the documentation,
> to make it easier for other people and ensure they won't run into the
> same problems you have.

How about splitting lower-level procedures and higher-level procedures?
I also don't understand why there are uri-generic and uri-common.
Can it be just like uri-generic provides the structure,
and uri-common provides processing procedures?

> > My code was (since it was from chicken3) based on the string-based
> > representation of URLs, hence I made some util functions as follows:
> > 
> > (define (get-path-from-uri uri)
> >   (define len (- (string-length prefix) 1))
> >   (let ([path (string-intersperse (cdr (uri-path uri)) "/")])
> > (and path
> >  (string-prefix? prefix path)
> >  (string-drop path len
> 
> What's "prefix" here?  It seems like an undefined variable.

It's something I use for my project, i.e. (define prefix "waitless/")

> If it's some directory which you want to strip from the path, you
> can use matchable (or do manual cons/car/cdring):
> 
> (match (uri-path uri)
>   (('/ "my" "prefix" . rest) (string-intersperse rest "/")) ;; Remove 
> /my/prefix
>   (else #f))

Oh, I've never used matchable. let me try.

> You can also construct the base URI and generate a relative reference
> using uri-relative-from, but then you have to be careful when the string
> is not a proper prefix (which you can verify by checking the first
> element for not being '/ or "..").
> 
> > (define (get-ref-url-from uri)
> >   (let ([baseuri (uri-reference (sprintf "~a://~a:~a/" (uri-scheme uri) 
> > (uri-host uri) (uri-p

[Chicken-users] how to handle http multipart/form-data

2010-10-01 Thread Daishi Kato
Dear Peter,

Another question regarding with chicken3->chicken4 porting.
I used the http-server-form-posts egg to handle multipart/form-data,
but the egg is not available (or not compatible) for chicken4.

How can I deal with mime multipart/form-data?

Best,
Daishi

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: I'm starting using chicken4 (Re: [Chicken-users] 4.6.1 performance boost

2010-10-01 Thread Daishi Kato
At Tue, 28 Sep 2010 19:36:32 +0200,
Peter Bex wrote:
> > I was heavily using the http egg in chicken3, which is
> > incompatible with chicken4.
> 
> Unfortunately, it is.  I like to think it's an improvement though :)

Yeah, I see that. It's clean.

> > In chicken3/http-server, I did something like:
> > (http:request-method-handler 'GET (lambda (req) ...
> > This is converted like the following in chicken4/spiffy.
> > (define (my-request-handler)
> >   (let* ([req (current-request)]
> >  [method (request-method req)])
> > (case method
> >   ((GET) (lambda (req) ...)
> >   ((POST) (lambda (req) ...)
> > (vhost-map `((".*" .
> >   ,(lambda (continue)
> >  (my-request-handler)
> 
> Yes, this is uglier.  There are several different request handling
> eggs now though!  They make it easier to handle incoming requests.

Is it that ugly?
None of the request handling eggs in the spiffy manual
was not so low level.

> Porting the old-style request handling stuff shouldn't be too hard,
> but I left it out because the way the old code worked is incompatible
> with vhost support.  The new Spiffy has vhost support built in from
> day 1.  Felix isn't happy about this change either, so you would
> probably make him very happy by making an egg that emulates the old
> API :)

I don't understand the discussion here. How felix isn't happy?
I thought the vhost support is very powerful.
(But, at the first look, I did't know how I could emulate
 low-level request handler.)

> > There were many tiny things for porting my code, such as dealing
> > with the fancy uri-common egg and string-match -> string-search.
> 
> Are you using "fancy" in a good way or in a bad way?  I'm really eager
> to hear how these new http libraries are being used and how people like
> them, so I can improve where things are not as smooth as they should be.

Good question. I used "fancy" in a good way, but if you ask me:
it might be too premitive, or there are too many procedures to understand.
My code was (since it was from chicken3) based on the string-based
representation of URLs, hence I made some util functions as follows:

(define (get-path-from-uri uri)
  (define len (- (string-length prefix) 1))
  (let ([path (string-intersperse (cdr (uri-path uri)) "/")])
(and path
 (string-prefix? prefix path)
 (string-drop path len

(define (get-ref-url-from uri)
  (let ([baseuri (uri-reference (sprintf "~a://~a:~a/" (uri-scheme uri) 
(uri-host uri) (uri-port uri)))])
(uri->string (uri-relative-from uri baseuri

(define (get-query-from-uri uri)
  (let ([query (uri-query uri)])
(and (pair? query)
 (map (lambda (x) (cons (symbol->string (car x)) (cdr x)))
  query

Please let me know if there's a better way of doing it.

> > Anyway it's nice to have it working, and
> > I would like thank everyone contributing to chicken4!
> 
> And I would like to thank you for switching and giving feedback!

You are welcome.

Best,
Daishi

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


I'm starting using chicken4 (Re: [Chicken-users] 4.6.1 performance boost

2010-09-28 Thread Daishi Kato
Hi,

I've been using chicken-3.[24].0 for years, but
Mario's email encouraged me to move my project to chicken4.

I was heavily using the http egg in chicken3, which is
incompatible with chicken4.

In chicken3/http-server, I did something like:
(http:request-method-handler 'GET (lambda (req) ...
This is converted like the following in chicken4/spiffy.
(define (my-request-handler)
  (let* ([req (current-request)]
 [method (request-method req)])
(case method
  ((GET) (lambda (req) ...)
  ((POST) (lambda (req) ...)
(vhost-map `((".*" .
  ,(lambda (continue)
 (my-request-handler)
   
I found one problem and filed ticket #401.

Porting my code from chicken3/http-client to chicken4/http-client
was fairly easy, except that I have to give up the proxy support.
So, Peter, my huge request is the proxy support.

There were many tiny things for porting my code, such as dealing
with the fancy uri-common egg and string-match -> string-search.

Anyway it's nice to have it working, and
I would like thank everyone contributing to chicken4!

Best,
Daishi

At Fri, 24 Sep 2010 09:17:20 -0400,
Mario Domenech Goulart wrote:
> 
> Hi
> 
> I don't know what kind of magic Felix is doing, but for a very quick,
> simple and limited benchmark I can see a BIG performance improvement
> when comparing 4.5.0 and 4.6.1.
> 
> I've run a simple "hello world" application with awful and run
> 
>   ab -n 1 -c 100 http://localhost:8080/
> 
> against it.
> 
> You can find the results for chicken 4.5.0 and 4.6.1 (using the same eggs
> versions) at http://parenteses.org/mario/misc/awful-chicken-bench.html
> 
> Best wishes.
> Mario
> -- 
> http://parenteses.org/mario
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/chicken-users

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] chicken-3.4.0 and locale egg

2009-11-25 Thread Daishi Kato
Thanks everybody for suggestions.
So far, no luck.

What is weird is if I load locale-timezone alone, there's no error.

CHICKEN
(c)2008 The Chicken Team
(c)2000-2007 Felix L. Winkelmann
Version 3.4.0 - linux-unix-gnu-x86  [ manyargs dload ptables applyhook ]
compiled 2009-11-18 on lobule (Linux)

#;1> (use locale-timezone)
; loading /usr/local/chicken-3.4.0-32/lib/chicken/3/locale-timezone.so ...
#;2> (use locale)
; loading /usr/local/chicken-3.4.0-32/lib/chicken/3/locale.so ...
; loading /usr/local/chicken-3.4.0-32/lib/chicken/3/locale-builtin.so ...
; loading /usr/local/chicken-3.4.0-32/lib/chicken/3/locale-posix.so ...
; loading /usr/local/chicken-3.4.0-32/lib/chicken/3/locale-categories.so ...
; loading /usr/local/chicken-3.4.0-32/lib/chicken/3/lookup-table.so ...
; loading /usr/local/chicken-3.4.0-32/lib/chicken/3/locale-components.so ...
; loading /usr/local/chicken-3.4.0-32/lib/chicken/3/locale-errors.so ...
Error: (string-parse-start+end) bad argument type - not a string: #f

Call history:

(use locale)
(##core#require-extension (quote locale))
(begin (begin (##sys#require (quote locale))) 
(##core#undefined))
(begin (##sys#require (quote locale)))
(##sys#require (quote locale))
(quote locale)
(##core#undefined)
  (##sys#require (quote locale))  <--
#;2>

And then, if I try loading the entire locale egg, it stops one loading before.
It's not understandable to me...

--daishi

At Wed, 18 Nov 2009 00:25:15 +0900,
Daishi Kato wrote:
> 
> Thanks for the suggestion.
> Unfortunately, changing the optimization options
> doesn't change the situation.
> 
> Daishi
> 
> At Thu, 12 Nov 2009 22:57:34 +0100,
> Jörg F. Wittenberger wrote:
> > 
> > Hi,
> > 
> > my experience might not be related to your problem here at all.
> > 
> > YMMV
> > 
> > But the past days I spent much time to track down a - for me new -
> > bug/problem relating to uhm, a special case:  I recently upgraded to
> > ubuntu 9.10 on a amd64 plattform.  All sudden my program ran into all
> > sorts of problems.  After some testing those did not look as
> > reproducible as at the beginning.  Instead they appeared to be sort of
> > random.
> > 
> > The temporary solution: don't use gcc version 4.4.1-4ubuntu8 on amd64
> > with -O3.  -O2 does work for me.  So much for MY special case.
> > 
> > I feel compelled to add that I recall having tracked down another bug on
> > a 64bit platform for a prior gcc version some years ago wrt. RScheme
> > generated code.
> > 
> > Take care.
> > 
> > /Jörg
> > 
> > Am Freitag, den 13.11.2009, 01:47 +0900 schrieb Daishi Kato:
> > > At Tue, 8 Sep 2009 18:34:23 -0700,
> > > Kon Lovett wrote:
> > > > 
> > > > 
> > > > On Sep 8, 2009, at 5:38 PM, Daishi Kato wrote:
> > > > 
> > > > > Hi Kon. Thank you very much for a quick response.
> > > > >
> > > > > I tried 0.5.1 and it was successful on one computer.
> > > > > As for the other computer, I'm compiling with -m32 on x86_64,
> > > > > so it's probably my special problem.
> > > > 
> > > > Please try to track this down. Sounds like a bug w/ Chicken 3.
> > > 
> > > Hi, it's been a while, but I found a difference.
> > > 
> > > Host(neuron): CentOS 5.4 (-m32 on x86_64) -> works fine
> > > Host(lobule): Ubuntu 8.04 (-m32 on x86_64) -> error!
> > > 
> > > The error is like this:
> > > 
> > > CHICKEN
> > > (c)2008 The Chicken Team
> > > (c)2000-2007 Felix L. Winkelmann
> > > Version 3.4.0 - linux-unix-gnu-x86  [ manyargs dload ptables 
> > > applyhook ]
> > > compiled 2009-11-13 on lobule (Linux)
> > > 
> > > #;1> (use locale)
> > > ; loading /usr/local/chicken-3.4.0-32/lib/chicken/3/locale.so ...
> > > ; loading /usr/local/chicken-3.4.0-32/lib/chicken/3/locale-builtin.so ...
> > > ; loading /usr/local/chicken-3.4.0-32/lib/chicken/3/locale-posix.so ...
> > > ; loading /usr/local/chicken-3.4.0-32/lib/chicken/3/locale-categories.so 
> > > ...
> > > ; loading /usr/local/chicken-3.4.0-32/lib/chicken/3/lookup-table.so ...
> > > ; loading /usr/local/chicken-3.4.0-32/lib/chicken/3/locale-components.so 
> > > ...
> > > ; loading /usr/local/chicken-3.4.0-32/lib/chicken/3/locale-errors.so ...
> > > ; loading /usr/local/chicken-3.4.0-32/lib/chicke

Re: [Chicken-users] chicken-3.4.0 and locale egg

2009-11-17 Thread Daishi Kato
Thanks for the suggestion.
Unfortunately, changing the optimization options
doesn't change the situation.

Daishi

At Thu, 12 Nov 2009 22:57:34 +0100,
Jörg F. Wittenberger wrote:
> 
> Hi,
> 
> my experience might not be related to your problem here at all.
> 
> YMMV
> 
> But the past days I spent much time to track down a - for me new -
> bug/problem relating to uhm, a special case:  I recently upgraded to
> ubuntu 9.10 on a amd64 plattform.  All sudden my program ran into all
> sorts of problems.  After some testing those did not look as
> reproducible as at the beginning.  Instead they appeared to be sort of
> random.
> 
> The temporary solution: don't use gcc version 4.4.1-4ubuntu8 on amd64
> with -O3.  -O2 does work for me.  So much for MY special case.
> 
> I feel compelled to add that I recall having tracked down another bug on
> a 64bit platform for a prior gcc version some years ago wrt. RScheme
> generated code.
> 
> Take care.
> 
> /Jörg
> 
> Am Freitag, den 13.11.2009, 01:47 +0900 schrieb Daishi Kato:
> > At Tue, 8 Sep 2009 18:34:23 -0700,
> > Kon Lovett wrote:
> > > 
> > > 
> > > On Sep 8, 2009, at 5:38 PM, Daishi Kato wrote:
> > > 
> > > > Hi Kon. Thank you very much for a quick response.
> > > >
> > > > I tried 0.5.1 and it was successful on one computer.
> > > > As for the other computer, I'm compiling with -m32 on x86_64,
> > > > so it's probably my special problem.
> > > 
> > > Please try to track this down. Sounds like a bug w/ Chicken 3.
> > 
> > Hi, it's been a while, but I found a difference.
> > 
> > Host(neuron): CentOS 5.4 (-m32 on x86_64) -> works fine
> > Host(lobule): Ubuntu 8.04 (-m32 on x86_64) -> error!
> > 
> > The error is like this:
> > 
> > CHICKEN
> > (c)2008 The Chicken Team
> > (c)2000-2007 Felix L. Winkelmann
> > Version 3.4.0 - linux-unix-gnu-x86  [ manyargs dload ptables applyhook ]
> > compiled 2009-11-13 on lobule (Linux)
> > 
> > #;1> (use locale)
> > ; loading /usr/local/chicken-3.4.0-32/lib/chicken/3/locale.so ...
> > ; loading /usr/local/chicken-3.4.0-32/lib/chicken/3/locale-builtin.so ...
> > ; loading /usr/local/chicken-3.4.0-32/lib/chicken/3/locale-posix.so ...
> > ; loading /usr/local/chicken-3.4.0-32/lib/chicken/3/locale-categories.so ...
> > ; loading /usr/local/chicken-3.4.0-32/lib/chicken/3/lookup-table.so ...
> > ; loading /usr/local/chicken-3.4.0-32/lib/chicken/3/locale-components.so ...
> > ; loading /usr/local/chicken-3.4.0-32/lib/chicken/3/locale-errors.so ...
> > ; loading /usr/local/chicken-3.4.0-32/lib/chicken/3/locale-timezone.so ...
> > Error: (string-parse-start+end) bad argument type - not a string: #f
> > 
> > Call history:
> > 
> > (use locale)
> > (##core#require-extension (quote locale))
> > (begin (begin (##sys#require (quote 
> > locale))) (##core#undefined))
> > (begin (##sys#require (quote locale)))
> > (##sys#require (quote locale))
> > (quote locale)
> > (##core#undefined)
> >   (##sys#require (quote locale))  <--
> > 
> > 
> > 
> > I used the same Makefile, with this patch:
> > 
> > 
> > % diff Makefile.linux Makefile.linux32
> > 32c32
> > < ARCH = $(shell sh $(SRCDIR)/config-arch.sh)
> > ---
> > > ARCH = x86
> > 39c39,40
> > < C_COMPILER_OPTIONS = -fno-strict-aliasing -DHAVE_CHICKEN_CONFIG_H
> > ---
> > > C_COMPILER_OPTIONS = -fno-strict-aliasing -DHAVE_CHICKEN_CONFIG_H -m32
> > > LINKER_OPTIONS = -m32
> > 
> > 
> > 
> > 
> > 
> > and resulting chicken-config.h was different:
> > 
> > 
> > % diff neuron-chicken-config.h lobule-chicken-config.h
> > 30,31c30,31
> > < #define C_BUILD_TAG "compiled 2009-07-27 on localhost.localdomain (Linux)"
> > < #define C_SVN_REVISION 11987
> > ---
> > > #define C_BUILD_TAG "compiled 2009-11-13 on lobule (Linux)"
> > > #define C_SVN_REVISION 0
> > 39c39
> > < # define C_INSTALL_CFLAGS "-fno-strict-aliasing -DHAVE_CHICKEN_CONFIG_H 
> > -Os -fomit-frame-pointer"
> > ---
> > > # define C_INSTALL_CFLAGS "-fno-strict-aliasing -DHAVE_CHICKEN_CONFIG_H 
> > > -m32 -Os -fomit-frame-pointer"
> > 42c42
> > < # defi

Re: [Chicken-users] chicken-3.4.0 and locale egg

2009-11-12 Thread Daishi Kato
At Tue, 8 Sep 2009 18:34:23 -0700,
Kon Lovett wrote:
> 
> 
> On Sep 8, 2009, at 5:38 PM, Daishi Kato wrote:
> 
> > Hi Kon. Thank you very much for a quick response.
> >
> > I tried 0.5.1 and it was successful on one computer.
> > As for the other computer, I'm compiling with -m32 on x86_64,
> > so it's probably my special problem.
> 
> Please try to track this down. Sounds like a bug w/ Chicken 3.

Hi, it's been a while, but I found a difference.

Host(neuron): CentOS 5.4 (-m32 on x86_64) -> works fine
Host(lobule): Ubuntu 8.04 (-m32 on x86_64) -> error!

The error is like this:

CHICKEN
(c)2008 The Chicken Team
(c)2000-2007 Felix L. Winkelmann
Version 3.4.0 - linux-unix-gnu-x86  [ manyargs dload ptables applyhook ]
compiled 2009-11-13 on lobule (Linux)

#;1> (use locale)
; loading /usr/local/chicken-3.4.0-32/lib/chicken/3/locale.so ...
; loading /usr/local/chicken-3.4.0-32/lib/chicken/3/locale-builtin.so ...
; loading /usr/local/chicken-3.4.0-32/lib/chicken/3/locale-posix.so ...
; loading /usr/local/chicken-3.4.0-32/lib/chicken/3/locale-categories.so ...
; loading /usr/local/chicken-3.4.0-32/lib/chicken/3/lookup-table.so ...
; loading /usr/local/chicken-3.4.0-32/lib/chicken/3/locale-components.so ...
; loading /usr/local/chicken-3.4.0-32/lib/chicken/3/locale-errors.so ...
; loading /usr/local/chicken-3.4.0-32/lib/chicken/3/locale-timezone.so ...
Error: (string-parse-start+end) bad argument type - not a string: #f

Call history:

(use locale)
(##core#require-extension (quote locale))
(begin (begin (##sys#require (quote locale))) 
(##core#undefined))
(begin (##sys#require (quote locale)))
(##sys#require (quote locale))
(quote locale)
(##core#undefined)
  (##sys#require (quote locale))  <--



I used the same Makefile, with this patch:


% diff Makefile.linux Makefile.linux32
32c32
< ARCH = $(shell sh $(SRCDIR)/config-arch.sh)
---
> ARCH = x86
39c39,40
< C_COMPILER_OPTIONS = -fno-strict-aliasing -DHAVE_CHICKEN_CONFIG_H
---
> C_COMPILER_OPTIONS = -fno-strict-aliasing -DHAVE_CHICKEN_CONFIG_H -m32
> LINKER_OPTIONS = -m32





and resulting chicken-config.h was different:


% diff neuron-chicken-config.h lobule-chicken-config.h
30,31c30,31
< #define C_BUILD_TAG "compiled 2009-07-27 on localhost.localdomain (Linux)"
< #define C_SVN_REVISION 11987
---
> #define C_BUILD_TAG "compiled 2009-11-13 on lobule (Linux)"
> #define C_SVN_REVISION 0
39c39
< # define C_INSTALL_CFLAGS "-fno-strict-aliasing -DHAVE_CHICKEN_CONFIG_H -Os 
-fomit-frame-pointer"
---
> # define C_INSTALL_CFLAGS "-fno-strict-aliasing -DHAVE_CHICKEN_CONFIG_H -m32 
> -Os -fomit-frame-pointer"
42c42
< # define C_INSTALL_LDFLAGS " "
---
> # define C_INSTALL_LDFLAGS "-m32 "
69c69
< # define C_DEFAULT_TARGET_STACK_SIZE (256*1024)
---
> # define C_DEFAULT_TARGET_STACK_SIZE (128*1024)
87c87
< # define C_TARGET_CFLAGS "-fno-strict-aliasing -DHAVE_CHICKEN_CONFIG_H -Os 
-fomit-frame-pointer"
---
> # define C_TARGET_CFLAGS "-fno-strict-aliasing -DHAVE_CHICKEN_CONFIG_H -m32 
> -Os -fomit-frame-pointer"
90c90
< # define C_TARGET_LDFLAGS " "
---
> # define C_TARGET_LDFLAGS "-m32 "





any clue?

--daishi


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] chicken-3.4.0 and locale egg

2009-09-08 Thread Daishi Kato
Hi all,

I remember there was a discussion about the locale egg,
but does it work now on chicken-3.4.0?
I tried with two computers and got different results.
Any help would be welcomed.

Best,
Daishi

8<--8<--8<--8<--8<--8<--8<--
CHICKEN
(c)2008 The Chicken Team
(c)2000-2007 Felix L. Winkelmann
Version 3.4.0 - linux-unix-gnu-x86  [ manyargs dload ptables applyhook ]
SVN rev. 11987  compiled 2009-09-07 on lobule (Linux)

#;1> (use locale)
; loading /usr/local/chicken-3.4.0/lib/chicken/3/locale.so ...
; loading /usr/local/chicken-3.4.0/lib/chicken/3/locale-builtin.so ...
; loading /usr/local/chicken-3.4.0/lib/chicken/3/locale-posix.so ...
; loading /usr/local/chicken-3.4.0/lib/chicken/3/locale-categories.so ...
; loading /usr/local/chicken-3.4.0/lib/chicken/3/lookup-table.so ...
; loading /usr/local/chicken-3.4.0/lib/chicken/3/locale-components.so ...
; loading /usr/local/chicken-3.4.0/lib/chicken/3/locale-errors.so ...
; loading /usr/local/chicken-3.4.0/lib/chicken/3/locale-timezone.so ...
Error: (string-parse-start+end) bad argument type - not a string: #f

Call history:

(use locale)
(##core#require-extension (quote locale))
(begin (begin (##sys#require (quote locale))) 
(##core#undefined))
(begin (##sys#require (quote locale)))
(##sys#require (quote locale))
(quote locale)
(##core#undefined)
  (##sys#require (quote locale))  <--
#;1>

8<--8<--8<--8<--8<--8<--8<--
CHICKEN
(c)2008 The Chicken Team
(c)2000-2007 Felix L. Winkelmann
Version 3.4.0 - linux-unix-gnu-x86  [ manyargs dload ptables applyhook ]
SVN rev. 11987  compiled 2009-09-09 on ganglia (Linux)

#;1> (use locale)
; loading /usr/local/chicken-3.4.0/lib/chicken/3/locale.so ...
; loading /usr/local/chicken-3.4.0/lib/chicken/3/locale-builtin.so ...
; loading /usr/local/chicken-3.4.0/lib/chicken/3/locale-posix.so ...
; loading /usr/local/chicken-3.4.0/lib/chicken/3/locale-categories.so ...
; loading /usr/local/chicken-3.4.0/lib/chicken/3/lookup-table.so ...
; loading /usr/local/chicken-3.4.0/lib/chicken/3/locale-components.so ...
; loading /usr/local/chicken-3.4.0/lib/chicken/3/locale-errors.so ...
; loading /usr/local/chicken-3.4.0/lib/chicken/3/locale-timezone.so ...
Error: (local-timezone) bad argument type - out of range
2009
8
0

Call history:

(use locale)
(##core#require-extension (quote locale))
(begin (begin (##sys#require (quote locale))) 
(##core#undefined))
(begin (##sys#require (quote locale)))
(##sys#require (quote locale))
(quote locale)
(##core#undefined)
  (##sys#require (quote locale))  <--
#;1>




___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] Re: mysql check connection

2009-06-17 Thread Daishi Kato
Hi everyone,

Although, I enjoy the news about moving to chicken4,
I'm still stick with chicken-3.2.0, mainly due to my heavy
dependence to the http egg.

Also, the mysql egg is one of my necesary eggs.
Since nobody seems to be maintaining releases/3/mysql/trunk,
(the latest code had even a parenthesis mismatch)
my colleague and I added a new procedure mysql-is-closed?,
just as I mentioned a long time ago.

Most of procedures now check a connection,
and if it's closed it raises a signal,
which avoids lot's of segfault errors.

Hope you like it.
Who should I ask for releasing this fixed egg?
Modifications are already committed to the svn trunk.
(One note is that I wasn't able to compile well the original one,
 which uses "my_bool". So, I changed it to "char". Please refer diffs.)

Thanks and I look for any feedbacks from someone.

Best,
Daishi

At Fri, 16 May 2008 19:38:37 +0900,
Daishi Kato wrote:
> 
> Hi, 
> 
> I was wondering if there's a procedure like mysql-closed?
> because I'd like to know if a connection is alive or not.
> Hoping mysql-ping does the job, but giving me a segfault.
> 
> Any workaround for this?
> Thanks,
> Daishi
> 
> CHICKEN
> (c)2008 The Chicken Team
> (c)2000-2007 Felix L. Winkelmann
> Version 3.2.0 - linux-unix-gnu-x86  [ manyargs dload ptables applyhook ]
> SVN rev. 10664  compiled 2008-05-16 on ganglia (Linux)
> 
> #;1> (use mysql)
> ; loading /usr/local/chicken-3.2.0/lib/chicken/3/mysql.so ...
> #;2> (define x (mysql-connect 'host: "192.168.1.130" 'user: "root" 'passwd: 
> "mahoroba0712" 'db: "tcwebif"))
> #;3> (mysql-ping x)
> 0
> #;4> (mysql-close x)
> #;5> (mysql-ping x)
> zsh: segmentation fault (core dumped) 
> 
> **
>  XREA.COM -Free Web Hosting-
>  http://www.xrea.com/
> **


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] z3: gzip compatibility

2008-12-02 Thread Daishi Kato
At Tue, 2 Dec 2008 11:05:26 +0100,
felix winkelmann wrote:
> 
> On Tue, Dec 2, 2008 at 11:01 AM, Daishi Kato <[EMAIL PROTECTED]> wrote:
> >
> > Can I do it without using the file? maybe using string or port.
> > In other words, how can I encode/decode the header.
> > The documentation does not seem to help me on it.
> >
> 
> Check out "z3:decode-buffer".

That was my first attempt.
(although, I misused read-file.)

Best,
Daishi


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] z3: gzip compatibility

2008-12-02 Thread Daishi Kato
At Tue, 2 Dec 2008 10:04:29 +0100,
Tobia Conforto wrote:
> 
> Daishi Kato wrote:
> > Does anyone know if I can use z3 egg to reproduce the same result  
> > made by gzip?
> 
> Yes you can, but you have to use the right functions.
> 
> Note that a file in gzip format includes some zlib-encoded data, after  
> a header, but it's not plain zlib-encoded data.
> 
> This works:
> 
> $ echo hello > test
> $ gzip test
> $ csi -q
> #;1> (use z3)
> ; loading /usr/local/lib/chicken/3/z3.so ...
> #;2> (read (z3:open-compressed-input-file "test.gz"))
> hello
> #;3>

Thanks Toiba and Felix.

Can I do it without using the file? maybe using string or port.
In other words, how can I encode/decode the header.
The documentation does not seem to help me on it.

I'm thinking of using it with http-server (or spiffy)
to support Content-Encoding: gzip.

Best,
Daishi


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] z3: gzip compatibility

2008-12-02 Thread Daishi Kato
Hi,

Does anyone know if I can use z3 egg
to reproduce the same result made by gzip?

My first attempt is the following.

Thanks for any help.

Best,
Daishi


[EMAIL PROTECTED] echo foo|gzip>foo.gz
[EMAIL PROTECTED] csi

CHICKEN
(c)2008 The Chicken Team
(c)2000-2007 Felix L. Winkelmann
Version 3.2.0 - linux-unix-gnu-x86  [ manyargs dload ptables applyhook ]
SVN rev. 10664  compiled 2008-05-28 on spirits (Linux)

#;1> (use z3)
; loading /usr/local/chicken-3.2.0/lib/chicken/3/z3.so ...
#;2> (z3:decode-buffer (read-file "foo.gz"))
Error: (string-length) bad argument type: (|?4IKe2~|)

Call history:

(z3:decode-buffer (read-file "foo.gz"))
(read-file "foo.gz")
  (z3:decode-buffer (read-file "foo.gz"))
  (read-file "foo.gz")<--
#;2>


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] compiling 32bit chicken on x86_64

2008-11-14 Thread Daishi Kato
At Fri, 31 Oct 2008 00:47:47 +0900,
Daishi Kato wrote:
> 
> At Thu, 30 Oct 2008 08:34:32 +0100 (CET),
> Sven Hartrumpf wrote:
> > 
> > Thu, 30 Oct 2008 09:25:12 +0900, daishi wrote:
> > 
> > > make -f Makefile.linux32 all
> > > make[1]: Entering directory `/home/daishi/src/chicken-3.2.0'
> > > gcc -m32 -shared  \
> > >   -o libchicken.so library.o eval.o data-structures.o extras.o lolevel.o 
> > > utils.o tcp.o srfi-1.o srfi-4.o srfi-13.o srfi-14.o srfi-18.o srfi-69.o 
> > > posixunix.o regex.o scheduler.o profiler.o stub.o match.o runtime.o 
> > > pcre/pcre_compile.o pcre/pcre_config.o pcre/pcre_dfa_exec.o 
> > > pcre/pcre_exec.o pcre/pcre_fullinfo.o pcre/pcre_get.o pcre/pcre_globals.o 
> > > pcre/pcre_info.o pcre/pcre_maketables.o pcre/pcre_newline.o 
> > > pcre/pcre_ord2utf8.o pcre/pcre_refcount.o pcre/pcre_study.o 
> > > pcre/pcre_tables.o pcre/pcre_try_flipped.o pcre/pcre_ucp_searchfuncs.o 
> > > pcre/pcre_valid_utf8.o pcre/pcre_version.o pcre/pcre_xclass.o 
> > > pcre/pcre_chartables.o apply-hack.x86.o -lm -ldl
> > > /usr/bin/ld: cannot find -lgcc_s_32
> > > collect2: ld returned 1 exit status
> > > make[1]: *** [libchicken.so] Error 1
> > > make[1]: Leaving directory `/home/daishi/src/chicken-3.2.0'
> > > make: *** [all] Error 2
> > >
> > > I'm not sure if it's a chicken issue...
> > 
> > Probably, an rpm for gcc support on 32bit is missing.
> > On a openSUSE 11.0 64bit box, it is named  gcc43-32bit:
> > > rpm -q -l gcc43-32bit
> > ...
> > /usr/lib64/gcc/x86_64-suse-linux/4.3/32/libgcc_s.so
> > /usr/lib64/gcc/x86_64-suse-linux/4.3/32/libgcc_s_32.so
> > ...
> 
> 
> Thanks.
> I am using CentOS4 for this thing,
> (whereas I usually use debian or ubuntu)
> and compat-gcc-32.x86_64 is installed.
> 
> $ find /usr/lib/ -name libgcc_s_32.so
> /usr/lib/gcc/x86_64-redhat-linux/3.4.3/libgcc_s_32.so
> /usr/lib/gcc-lib/x86_64-redhat-linux/3.2.3/libgcc_s_32.so
> 
> Probably, this is not the right one.

Hi,

I figured out this. It WAS a CentOS4 issue.
I managed to install some packages.

The patch for Makefile was also OK.
It might be useful for somebody (attached again)

Thanks!

Best,
Daishi

% diff Makefile.linux Makefile.linux32 
30c30
< ARCH = $(shell sh config-arch.sh)
---
> ARCH = x86
34c34,35
< C_COMPILER_OPTIONS = -fno-strict-aliasing -DHAVE_CHICKEN_CONFIG_H
---
> C_COMPILER_OPTIONS = -fno-strict-aliasing -DHAVE_CHICKEN_CONFIG_H -m32
> LINKER_OPTIONS = -m32


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] compiling 32bit chicken on x86_64

2008-10-30 Thread Daishi Kato
At Thu, 30 Oct 2008 08:34:32 +0100 (CET),
Sven Hartrumpf wrote:
> 
> Thu, 30 Oct 2008 09:25:12 +0900, daishi wrote:
> 
> > make -f Makefile.linux32 all
> > make[1]: Entering directory `/home/daishi/src/chicken-3.2.0'
> > gcc -m32 -shared  \
> >   -o libchicken.so library.o eval.o data-structures.o extras.o lolevel.o 
> > utils.o tcp.o srfi-1.o srfi-4.o srfi-13.o srfi-14.o srfi-18.o srfi-69.o 
> > posixunix.o regex.o scheduler.o profiler.o stub.o match.o runtime.o 
> > pcre/pcre_compile.o pcre/pcre_config.o pcre/pcre_dfa_exec.o 
> > pcre/pcre_exec.o pcre/pcre_fullinfo.o pcre/pcre_get.o pcre/pcre_globals.o 
> > pcre/pcre_info.o pcre/pcre_maketables.o pcre/pcre_newline.o 
> > pcre/pcre_ord2utf8.o pcre/pcre_refcount.o pcre/pcre_study.o 
> > pcre/pcre_tables.o pcre/pcre_try_flipped.o pcre/pcre_ucp_searchfuncs.o 
> > pcre/pcre_valid_utf8.o pcre/pcre_version.o pcre/pcre_xclass.o 
> > pcre/pcre_chartables.o apply-hack.x86.o -lm -ldl
> > /usr/bin/ld: cannot find -lgcc_s_32
> > collect2: ld returned 1 exit status
> > make[1]: *** [libchicken.so] Error 1
> > make[1]: Leaving directory `/home/daishi/src/chicken-3.2.0'
> > make: *** [all] Error 2
> >
> > I'm not sure if it's a chicken issue...
> 
> Probably, an rpm for gcc support on 32bit is missing.
> On a openSUSE 11.0 64bit box, it is named  gcc43-32bit:
> > rpm -q -l gcc43-32bit
> ...
> /usr/lib64/gcc/x86_64-suse-linux/4.3/32/libgcc_s.so
> /usr/lib64/gcc/x86_64-suse-linux/4.3/32/libgcc_s_32.so
> ...


Thanks.
I am using CentOS4 for this thing,
(whereas I usually use debian or ubuntu)
and compat-gcc-32.x86_64 is installed.

$ find /usr/lib/ -name libgcc_s_32.so
/usr/lib/gcc/x86_64-redhat-linux/3.4.3/libgcc_s_32.so
/usr/lib/gcc-lib/x86_64-redhat-linux/3.2.3/libgcc_s_32.so

Probably, this is not the right one.

Best,
Daishi


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] compiling 32bit chicken on x86_64

2008-10-29 Thread Daishi Kato
Here it is:

make -f Makefile.linux32 all
make[1]: Entering directory `/home/daishi/src/chicken-3.2.0'
gcc -m32 -shared  \
  -o libchicken.so library.o eval.o data-structures.o extras.o lolevel.o 
utils.o tcp.o srfi-1.o srfi-4.o srfi-13.o srfi-14.o srfi-18.o srfi-69.o 
posixunix.o regex.o scheduler.o profiler.o stub.o match.o runtime.o 
pcre/pcre_compile.o pcre/pcre_config.o pcre/pcre_dfa_exec.o pcre/pcre_exec.o 
pcre/pcre_fullinfo.o pcre/pcre_get.o pcre/pcre_globals.o pcre/pcre_info.o 
pcre/pcre_maketables.o pcre/pcre_newline.o pcre/pcre_ord2utf8.o 
pcre/pcre_refcount.o pcre/pcre_study.o pcre/pcre_tables.o 
pcre/pcre_try_flipped.o pcre/pcre_ucp_searchfuncs.o pcre/pcre_valid_utf8.o 
pcre/pcre_version.o pcre/pcre_xclass.o pcre/pcre_chartables.o apply-hack.x86.o 
-lm -ldl
/usr/bin/ld: cannot find -lgcc_s_32
collect2: ld returned 1 exit status
make[1]: *** [libchicken.so] Error 1
make[1]: Leaving directory `/home/daishi/src/chicken-3.2.0'
make: *** [all] Error 2

I'm not sure if it's a chicken issue...

Best,
Daishi

At Wed, 29 Oct 2008 15:50:28 +0100,
felix winkelmann wrote:
> 
> On Wed, Oct 29, 2008 at 3:33 PM, Daishi Kato <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > Has anybody tried compiling 32bit chicken on x86_64?
> > I made a special Makefile, but giving me an error.
> > I'm totally not sure if this is the right way or not.
> > Thanks for any comments.
> 
> Can you give us the error message?
> 
> 
> cheers,
> felix
> 
> **
>  XREA.COM -Free Web Hosting-
>  http://www.xrea.com/
> **


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] compiling 32bit chicken on x86_64

2008-10-29 Thread Daishi Kato
Hi,

Has anybody tried compiling 32bit chicken on x86_64?
I made a special Makefile, but giving me an error.
I'm totally not sure if this is the right way or not.
Thanks for any comments.

Best,
Daishi

% diff Makefile.linux Makefile.linux32 
30c30
< ARCH = $(shell sh config-arch.sh)
---
> ARCH = x86
34c34,35
< C_COMPILER_OPTIONS = -fno-strict-aliasing -DHAVE_CHICKEN_CONFIG_H
---
> C_COMPILER_OPTIONS = -fno-strict-aliasing -DHAVE_CHICKEN_CONFIG_H -m32
> LINKER_OPTIONS = -m32


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] pretty-print

2008-08-27 Thread Daishi Kato
Hi,

This is more like a general scheme or lisp question,
but does anybody know how I can get a formal rule
for pretty print?

I want to implement pretty print in non-scheme
programming language.

Thanks.
Daishi


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] libsvm egg install problem

2008-06-04 Thread Daishi Kato
   /home/cowboyneal/bin/csc -feature compiling-extension -s -O2
> > libsvm_core.scm libsvm_core_wrap.c -lsvm -lsupc++
> > -I/usr/include/libsvm-2.0/libsvm /home/cowboyneal/bin/csc -feature
> > compiling-extension -s -O2 libsvm.scm rm -fr
> > /home/cowboyneal/lib/chicken/3/libsvm.so
> >   cp -r libsvm.so /home/cowboyneal/lib/chicken/3/libsvm.so
> >   chmod a+r /home/cowboyneal/lib/chicken/3/libsvm.so
> >   rm -fr /home/cowboyneal/lib/chicken/3/libsvm_core.so
> >   cp -r libsvm_core.so /home/cowboyneal/lib/chicken/3/libsvm_core.so
> >   chmod a+r /home/cowboyneal/lib/chicken/3/libsvm_core.so
> >   chmod a+r /home/cowboyneal/lib/chicken/3/libsvm.setup-info
> > --
> >
> > All seemed well until I ran the test code ..
> > which ended with a SegFault.
> >
> > --
> > [EMAIL PROTECTED] ~]$ csi svm.scm
> > CHICKEN
> > (c)2008 The Chicken Team
> > (c)2000-2007 Felix L. Winkelmann
> > Version 3.1.0 - linux-unix-gnu-x86      [ manyargs dload ptables applyhook
> > ] SVN rev. 10106  compiled 2008-05-20 on giliath (Linux)
> > ; loading svm.scm ...
> > ; loading /home/cowboyneal/lib/chicken/3/libsvm.so ...
> > ; loading /home/cowboyneal/lib/chicken/3/libsvm_core.so ...
> > Segmentation fault
> > --
> >
> > Looks like it's dying when loading the actual libsvm.so.1 ..
> > Did I mess up in building it?
> >
> > > > g++ -fPIC -Wall -O3 -c svm.cpp
> > > > ld -shared -soname libsvm.so.1 -o libsvm.so.1.0 -lc svm.o
> > > > I then moved the .so into my ~/lib directory with appropriate
> > > > symbolic links ..
> > > > libsvm.so.1.0
> > > > libsvm.so.1 -> libsvm.so.1.0
> > > > libsvm.so -> libsvm.so.1.0
> > > > and ran ldconfig
> >
> > Any thoughts appreciated ..
> >
> > Tom
> >
> > On Wednesday 28 May 2008 04:39, Daishi Kato wrote:
> > > Hi,
> > >
> > > I've updated the egg (v1.1), which hopefully works fine.
> > > Please give it a try.
> > >
> > > I've been testing against debian libsvm package.
> > > --daishi
> > >
> > > At Tue, 27 May 2008 12:50:13 -0700,
> > >
> > > Tom Poliquin wrote:
> > > > I'm trying to install the libsvm egg and not
> > > > having much success.
> > > >
> > > > The libsvm egg requires the libsvm library.
> > > >
> > > > I downloaded the only libsvm library I could find from
> > > > http://www.csie.ntu.edu.tw/~cjlin/libsvm/
> > > > (libsvm-2.86) which after installation only generates an svm.o.
> > > > I tried some older versions hoping to find one generating an 'so'
> > > > file but was unsuccessful.
> > > >
> > > > Undaunted, (and not an shared library expert) I did this ..
> > > > g++ -fPIC -Wall -O3 -c svm.cpp
> > > > ld -shared -soname libsvm.so.1 -o libsvm.so.1.0 -lc svm.o
> > > >
> > > > I then moved the .so into my ~/lib directory with appropriate
> > > > symbolic links ..
> > > > libsvm.so.1.0
> > > > libsvm.so.1 -> libsvm.so.1.0
> > > > libsvm.so -> libsvm.so.1.0
> > > > and ran ldconfig
> > > >
> > > > I then ran the egg install (I'm using
> > > > Chicken 3.1.0) and got ..
> > > >
> > > >   The extension libsvm does not exist.
> > > >   Do you want to download it ? (yes/no/abort) [yes] yes
> > > >   downloading libsvm.egg from (www.call-with-current-continuation.org
> > > > eggs/ 3 80) .
> > > >   gzip -d -c /tmp/chicken-setup-3-cowboyneal/downloads/libsvm.egg | tar
> > > > xf - /home/cowboyneal/bin/csc -feature compiling-extension -s -O2
> > > > libsvm.scm Warning: extension `libsvm_core' is currently not installed
> > > >   /home/cowboyneal/bin/csc
> > > >        -feature compiling-extension -s -O2 libsvm_core.scm l
> > > >   ibsvm_core_wrap.c -lsvm -I/usr/include/libsvm-2.0/libsvm
> > > >   Error: unbound variable: documentation
> > > >
> > > > Looks like I also need a libsvm_core.so .. I'm guessing I haven't
> > > > downloaded the right libsvm .. ?
> > > >
> > > > Any thoughts greatly appreciated,
> > > >
> > > > Tom
> > > >
> > > >
> > > >
> > > > ___
> > > > Chicken-users mailing list
> > > > Chicken-users@nongnu.org
> > > > http://lists.nongnu.org/mailman/listinfo/chicken-users
> > > >
> > > > **
> > > >  XREA.COM -Free Web Hosting-
> > > >  http://www.xrea.com/
> > > > **


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] libsvm egg install problem

2008-05-28 Thread Daishi Kato
Hi,

I've updated the egg (v1.1), which hopefully works fine.
Please give it a try.

I've been testing against debian libsvm package.
--daishi

At Tue, 27 May 2008 12:50:13 -0700,
Tom Poliquin wrote:
> 
> I'm trying to install the libsvm egg and not
> having much success.
> 
> The libsvm egg requires the libsvm library.
> 
> I downloaded the only libsvm library I could find from
> http://www.csie.ntu.edu.tw/~cjlin/libsvm/
> (libsvm-2.86) which after installation only generates an svm.o.
> I tried some older versions hoping to find one generating an 'so'
> file but was unsuccessful.
> 
> Undaunted, (and not an shared library expert) I did this ..
> g++ -fPIC -Wall -O3 -c svm.cpp
> ld -shared -soname libsvm.so.1 -o libsvm.so.1.0 -lc svm.o
> 
> I then moved the .so into my ~/lib directory with appropriate
> symbolic links ..
> libsvm.so.1.0
> libsvm.so.1 -> libsvm.so.1.0
> libsvm.so -> libsvm.so.1.0
> and ran ldconfig
> 
> I then ran the egg install (I'm using
> Chicken 3.1.0) and got ..
> 
>   The extension libsvm does not exist.
>   Do you want to download it ? (yes/no/abort) [yes] yes
>   downloading libsvm.egg from (www.call-with-current-continuation.org eggs/
>   3 80) .
>   gzip -d -c /tmp/chicken-setup-3-cowboyneal/downloads/libsvm.egg | tar xf -
>/home/cowboyneal/bin/csc -feature compiling-extension -s -O2 libsvm.scm
>   Warning: extension `libsvm_core' is currently not installed
>   /home/cowboyneal/bin/csc 
>-feature compiling-extension -s -O2 libsvm_core.scm l
>   ibsvm_core_wrap.c -lsvm -I/usr/include/libsvm-2.0/libsvm
>   Error: unbound variable: documentation
> 
> Looks like I also need a libsvm_core.so .. I'm guessing I haven't
> downloaded the right libsvm .. ?
> 
> Any thoughts greatly appreciated,
> 
> Tom
> 
> 
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/chicken-users
> 
> **
>  XREA.COM -Free Web Hosting-
>  http://www.xrea.com/
> **


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] mysql check connection

2008-05-16 Thread Daishi Kato
Hi, 

I was wondering if there's a procedure like mysql-closed?
because I'd like to know if a connection is alive or not.
Hoping mysql-ping does the job, but giving me a segfault.

Any workaround for this?
Thanks,
Daishi

CHICKEN
(c)2008 The Chicken Team
(c)2000-2007 Felix L. Winkelmann
Version 3.2.0 - linux-unix-gnu-x86  [ manyargs dload ptables applyhook ]
SVN rev. 10664  compiled 2008-05-16 on ganglia (Linux)

#;1> (use mysql)
; loading /usr/local/chicken-3.2.0/lib/chicken/3/mysql.so ...
#;2> (define x (mysql-connect 'host: "192.168.1.130" 'user: "root" 'passwd: 
"mahoroba0712" 'db: "tcwebif"))
#;3> (mysql-ping x)
0
#;4> (mysql-close x)
#;5> (mysql-ping x)
zsh: segmentation fault (core dumped) 


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] thread-sleep! using milliseconds->time is broken

2008-04-07 Thread Daishi Kato
(thread-sleep! (milliseconds->time (+ 500 (current-milliseconds

should be file. --daishi

At Mon, 7 Apr 2008 11:47:26 -0600,
Jim Ursetto wrote:
> 
> So I need to do this?
> 
> (thread-sleep!
>   (milliseconds->time (+ 500 (time->milliseconds (current-time)
> 
> On 4/7/08, felix winkelmann <[EMAIL PROTECTED]> wrote:
> > >  #;3> (thread-sleep! (milliseconds->time 1000))  ; returns immediately
> > The seconds/milliseconds argument must be absolute, not relative.
> > As specified in srfi-18:
> 
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/chicken-users
> 
> **
>  XREA.COM -Free Web Hosting-
>  http://www.xrea.com/
> **


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] yaml parser

2008-03-17 Thread Daishi Kato
Hi,

Has anybody thought about making a yaml parser?
I could not search the mail archive due to index corruption.
It is possible to base on json-{read|write}, isn't it?

--daishi


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


readline (was Re: [Chicken-users] regex problem

2008-02-27 Thread Daishi Kato
There was a certain reason why I use rlwrap over readline,
but I forgot what the functionality that works only with rlwrap was.
I want to control whether to use readline or not,
and I prefer "rlwrap csi" to "csi -n".
Daishi

At Thu, 28 Feb 2008 07:18:28 +0100,
Leonardo Valeri Manera wrote:
> 
> On 28/02/2008, Daishi Kato <[EMAIL PROTECTED]> wrote:
> > rlwrap -s 1 /usr/local/chicken-3.0.0/bin/csi
> 
> Unrelated, but why rlwrap over the readline egg?
> 
> Just curious.
> 
> Leo


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Unfair question: best Lisp for web development?

2008-02-27 Thread Daishi Kato
At Wed, 27 Feb 2008 20:58:44 -0500,
Graham Fawcett wrote:
> 
> Hi Jim,
> 
> On Wed, Feb 27, 2008 at 5:01 PM, Jim Ursetto <[EMAIL PROTECTED]> wrote:
> > On 2/27/08, Graham Fawcett <[EMAIL PROTECTED]> wrote:
> >  > Personally, I don't use Spiffy; I wrote a custom framework instead.
> >
> >  Would you mind expanding a little on your custom framework and
> >  whether it resides behind another webserver via mod_proxy, scgi,
> >  fastcgi, cgi, or is itself the main webserver?
> 
> Sure. My first version was an SCGI server, but later I switched to
> HTTP. I usually host behind Apache, and moving from mod_scgi to
> mod_proxy was pretty straightforward, and in return it's much easier
> to test when Apache isn't running. I also like that using HTTP as the
> only protocol means that you can deploy apps in small-scale,
> standalone situations (e.g. "localhost" workstation apps).

Hi,
I'm also curious on this for I'm now running a HTTP server
and thinking to change it to an SCGI server (using web-unity).
Is the performance technically the same in these cases?
Also, do mod_scgi and mod_proxy handle long-lived connections
(a.k.a. COMET connections) very well?

Thanks for your comments.
Daishi


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] regex problem

2008-02-27 Thread Daishi Kato
Hi!

I got a segfault error.
Sorry, I have no access to Trac right now.

Daishi

CHICKEN
Version 3.0.0 - linux-unix-gnu-x86  [ manyargs dload ptables applyhook ]
(c)2000-2008 Felix L. Winkelmanncompiled 2008-02-28 on ganglia (Linux)

#;1> (use regex)
; loading library regex ...
#;2> (string-match (regexp "(a)*") (make-string 100 #\a))
(""
 "a")
#;3> (string-match (regexp "(a)*") (make-string 1000 #\a))
(""
 "a")
#;4> (string-match (regexp "(a)*") (make-string 1 #\a))
zsh: segmentation fault (core dumped)  rlwrap -s 1 
/usr/local/chicken-3.0.0/bin/csi


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] recursive mutex-lock!

2008-02-27 Thread Daishi Kato
Thanks a lot Vincent and Toiba!

I was wondering if such a piece of code is already existed,
since recursive locking is fairly intuitive.
I also found chicken detects recursive locking as a dead lock,
and raises an error, but runs finely.

--daishi

At Tue, 26 Feb 2008 17:46:15 -0800,
Vincent Manis wrote:
> 
> On 2008 Feb 26, at 16:04, Tobia Conforto wrote:
> 
> >
> > Well, the value returned by mutex-state can be either:
> >
> > locked by this thread
> > In this case there can be no race condition, as we own
> > the mutex and nothing is going to take it away from us.
> >
> > locked by another thread
> > abandoned
> > not-abandoned
> > In these cases the mutex is not ours, therefore we don't care
> > if it's locked or not, or if any other thread locks or unlocks
> > it in a race condition, because we'll call mutex-lock! anyway.
> >
> > not-owned
> > This I can't tell, as I have no clue what not-owned means :-)
> ...
> > My ¢2 analysis says you can get away without a conditional lock, if  
> > you just ignore the existence of a not-owned state.
> 
> You are exactly right, Tobia, and my apologies to Daishi, I should  
> know better
> than to look at threaded code at 1am :-)
> 
> Just a couple of clarifications. A race condition can occur if you do  
> a test
> for *un*locked and then attempt to lock the mutex, but in this case,  
> as Tobia
> says, the lock will hold. The not-owned case can only occur if someone  
> locks
> the thread anonymously, which nobody ever does, and is yet another  
> example of
> how Posix threads are overengineered.
> 
> There is a way of making this code fail by writing incorrect code.  
> Suppose a
> signal handler (say for SIGALRM) unlocks the mutex just after the  
> test. Then
> the code will assume that the mutex is locked when it isn't.  
> Fortunately,
> signal handlers aren't allowed to do things like that, so it's a case  
> one should
> be aware of but not worry about.
> 
> Let me put in a plug for my favorite book on concurrent programming,  
> Doug Lea's
> _Concurrent Programming in Java_, which, despite the title and the  
> fact that it's
> in Addison-Wesley's Java series, is much more about concurrency than  
> about Java.
> 
> 
> -- v
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/chicken-users
> 
> **
>  XREA.COM -Free Web Hosting-
>  http://www.xrea.com/
> **


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] nondescript eggs

2008-02-25 Thread Daishi Kato
Hi,

swt should be fine if jni works well,
but it's not tested and I'm not going to maintain it.

On the other hand, I would like to continue to develop
wxchicken, which is not complete yet at all,
but I'm currently not working on it due to time limitation.
Any help would be welcome.

Daishi

At Sun, 24 Feb 2008 15:31:23 +0100 (CET),
Felix Winkelmann wrote:
> 
> 
> Hello!
> 
> The following eggs have currently no ".meta" file and seem to
> be in a state of flux, or have not been implemented yet
> (but are registered in the repository:
> 
> * binary-tree/
> * dns/
> * filesystem/
> * gl-display-glx/
> * gl-font/
> * libapreq-mfd-parser/
> * meroonet/
> * methods/
> * minioop/
> * scoop/
> * sockets/
> * statvfs/
> * swt/
> * wxchicken/
> 
> These have been moved into the "nondescript" branch and can be
> accessed as usual (the permissions will be updated accordingly).
> Whoever is working on these, please consider moving them into
> the release/3 branch later, once you think they are ready for
> being made available.
> 
> 
> cheers,
> felix
> 
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/chicken-users
> 
> **
>  XREA.COM -Free Web Hosting-
>  http://www.xrea.com/
> **


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] recursive mutex-lock!

2008-02-25 Thread Daishi Kato
At Mon, 25 Feb 2008 00:52:25 -0800,
Vincent Manis wrote:
> 
> On 2008 Feb 25, at 00:19, Daishi Kato wrote:
> 
> > Hi,
> >
> > SRFI-18 states,
> >
> > The mutex primitives specified in this SRFI do not implement  
> > "recursive" mutex semantics; an attempt to lock a mutex that is  
> > locked implies that the current thread must wait even if the mutex  
> > is owned by the current thread
> >
> > so, I want a macro or procedure to support "recursive" mutex.
> > Would be glad someone can note on it.
> >
> > Here's my macro, not sure if it works:
> > Isn't there a similar code?
> >
> > (define my-mutex (make-mutex))
> > (define-macro (my-lock . body)
> >  `(let ([result #f])
> > (if (eq? (mutex-state my-mutex) (current-thread))
> > (set! result (begin ,@body))
> > ;;else
> > (begin
> >   (mutex-lock! my-mutex)
> >   (set! result (begin ,@body))
> >   (mutex-unlock! my-mutex)))
> > result))
> >
> I have actually never used the Chicken threading capabilities, but  
> with almost
> any mutex code it's a safe bet that there's  race condition. In this  
> case, is
> it possible that the mutex could become locked between a false eq?  
> result and
> the call of mutex-lock! ?
> 
> I think recursive mutex locking almost always needs a conditional lock  
> operation.

Yes, that was my question, too.
I was writing with a conditional lock for this,
but wondering if it might be ok with this case
of eq?ing with (current-thread).

Any other comments?
--daishi


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] recursive mutex-lock!

2008-02-25 Thread Daishi Kato
Hi,

SRFI-18 states,

The mutex primitives specified in this SRFI do not implement "recursive" mutex 
semantics; an attempt to lock a mutex that is locked implies that the current 
thread must wait even if the mutex is owned by the current thread

so, I want a macro or procedure to support "recursive" mutex.
Would be glad someone can note on it.

Here's my macro, not sure if it works:
Isn't there a similar code?

(define my-mutex (make-mutex))
(define-macro (my-lock . body)
  `(let ([result #f])
 (if (eq? (mutex-state my-mutex) (current-thread))
 (set! result (begin ,@body))
 ;;else
 (begin
   (mutex-lock! my-mutex)
   (set! result (begin ,@body))
   (mutex-unlock! my-mutex)))
 result))


--daishi


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] understanding eval

2008-02-22 Thread Daishi Kato
Ah, I see. Thanks a lot! --daishi

At Fri, 22 Feb 2008 14:08:25 +0100,
Peter Bex wrote:
> 
> On Fri, Feb 22, 2008 at 09:57:42PM +0900, Daishi Kato wrote:
> > OK, so that was stupid.
> > 
> > How about this?
> > 
> > (define a 'values)
> > (define b '((1 2 3) #(4 5 6))
> > 
> > I'd like to evaluate (values '(1 2 3) '#(4 5 6))
> > using eval, a and b.
> 
> More of the same:
> (eval (cons a (map (cut list 'quote <>) b)))
> 
> HTH,
> Peter
> -- 
> http://sjamaan.ath.cx
> --
> "The process of preparing programs for a digital computer
>  is especially attractive, not only because it can be economically
>  and scientifically rewarding, but also because it can be an aesthetic
>  experience much like composing poetry or music."
>   -- Donald Knuth


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] understanding eval

2008-02-22 Thread Daishi Kato
OK, so that was stupid.

How about this?

(define a 'values)
(define b '((1 2 3) #(4 5 6))

I'd like to evaluate (values '(1 2 3) '#(4 5 6))
using eval, a and b.

--daishi

At Fri, 22 Feb 2008 13:29:55 +0100,
Peter Bex wrote:
> On Fri, Feb 22, 2008 at 09:22:36PM +0900, Daishi Kato wrote:
> > Hi,
> > 
> > This might be a stupid question,
> > but would someone help me understand the following eval example?
> > I was expecting to get 1.
> 
> You're evaluating (car (1 2 3))
> You want to be evaluating (car (list 1 2 3)) or (car (quote (1 2 3)))
> 
> > 8<--8<--8<--8<--8<--8<--8<--8<--
> > 
> > CHICKEN
> > Version 2.732 - linux-unix-gnu-x86  [ manyargs dload ptables applyhook 
> > cross ]
> > (c)2000-2007 Felix L. Winkelmanncompiled 2007-12-04 on spirits 
> > (Linux)
> > 
> > #;1> (define a 'car)
> > #;2> (define b '(1 2 3))
> > #;3> (eval (list a b))
> > Error: call of non-procedure: 1
> > 
> > Call history:
> > 
> > (eval (list a b))
> > (list a b)
> >   (eval (list a b))
> >   (list a b)
> > (car (1 2 3))
> > (1 2 3)
> >   (car (1 2 3))
> >   (1 2 3) <--
> 
> Cheers,
> Peter
> -- 
> http://sjamaan.ath.cx
> --
> "The process of preparing programs for a digital computer
>  is especially attractive, not only because it can be economically
>  and scientifically rewarding, but also because it can be an aesthetic
>  experience much like composing poetry or music."
>   -- Donald Knuth


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] understanding eval

2008-02-22 Thread Daishi Kato
Hi,

This might be a stupid question,
but would someone help me understand the following eval example?
I was expecting to get 1.

Daishi

8<--8<--8<--8<--8<--8<--8<--8<--

CHICKEN
Version 2.732 - linux-unix-gnu-x86  [ manyargs dload ptables applyhook 
cross ]
(c)2000-2007 Felix L. Winkelmanncompiled 2007-12-04 on spirits (Linux)

#;1> (define a 'car)
#;2> (define b '(1 2 3))
#;3> (eval (list a b))
Error: call of non-procedure: 1

Call history:

(eval (list a b))
(list a b)
  (eval (list a b))
  (list a b)
(car (1 2 3))
(1 2 3)
  (car (1 2 3))
  (1 2 3) <--


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] proposed change to http-client

2008-02-14 Thread Daishi Kato
Hi,

First of all, I'm so much confortable with your modification,
and I understand that you keep the original behaviour.
I'm proposeing to rewrite http-client.
Sorry for the confusion.

--daishi

At Thu, 14 Feb 2008 15:36:42 -0800 (PST),
Elf wrote:
> 
> 
> On Fri, 15 Feb 2008, Daishi Kato wrote:
> 
> > Hi,
> >
> > Why on earth do you want to add "Connection: close" in HTTP/1.0?
> > I think it's meaning-less, I'd propose just
> > to remove adding this header in http:POST, http:GET and http:send-request.
> >
> > Although I'm not sure why http:GET and http:send-request has been
> > adding "Connection: close".
> 
> why did i add it?  i didnt add it.  it was there originally when i started 
> modifying the one function.  the goal was not to do a complete rewrite of the
> http egg, it was to make one particular procedure work correctly over its
> inputs. (the previous state had erroneous assumptions on content.)  i left it
> there because a) it doesnt hurt anything to make it explicit b) it was put
> there initially by someone who knew what they were doing and c) i had neither
> the time nor inclination to try tracing and refactoring an entire egg, 
> especially one that is widely used and is a core component of a lot of 
> interesting very active things.  the one method changed will act exactly the
> way it did before i changed it for the various eggs that use it.  if i 
> randomly
> remove things, i cannot guarantee that things wont break. (not that i can
> guarantee this regardless, but i can demonstrate that for all eggs currently
> in the repo that use http-client will get exactly the same request objects
> sent out as they did before i changed it.)
> 
> 
> -elf
> 
> 
> **
>  XREA.COM -Free Web Hosting-
>  http://www.xrea.com/
> **


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] documentation issues...

2008-02-14 Thread Daishi Kato
Hi,

Is it true that if you have svn write access,
you can just edit the wiki/* files and commit them,
which reflects to the web pages?
My understanding is that this is a nice feature of svnwiki.

Well, my assumption is that developers use Emacs or Vim,
non-developers don't and developers could get the write access.

Correct me if it's wrong.

Daishi

At Thu, 14 Feb 2008 14:19:46 -0600,
Jim Ursetto wrote:
> 
> Select all in the preview window, cut and paste to Emacs or Vim, edit, and
> paste the text back to the wiki. I do it all the time, and it solves every one
> of these issues. (Modern browsers handle most of them, too.) You can also use
> `svn up` for the import step, but the preview window is still preferable to
> `svn ci` as you can see the result, unless you're making a small change or 
> like
> to live dangerously.
> 
> On 2/14/08, Elf <[EMAIL PROTECTED]> wrote:
> > a) im stuck in a tiny window in a tiny screen with no real text manipulation
> > abilities.
> > b) theres no search and replace. theres no way of even killing lines off.
> > c) cut and paste is fickle about where the mosue is, not where the cursor
> > is.
> > d) theres no undo. theres no redo. theres no means of even taking it
> > offline
> > effectively.
> > e) and the real dealbreaker once i was 99.99% done  and loading the
> > preview... it froze in the middle of displaying. claimed it was done
> > (ie,
> > not a network error or something.) theres no buttons at the top to
> > force
> > a save or anything. meaning at 8.5 hours in, i had to start over almost
> > from the beginning.
> 
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/chicken-users
> 
> **
>  XREA.COM -Free Web Hosting-
>  http://www.xrea.com/
> **


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] proposed change to http-client

2008-02-14 Thread Daishi Kato
Hi,

Why on earth do you want to add "Connection: close" in HTTP/1.0?
I think it's meaning-less, I'd propose just
to remove adding this header in http:POST, http:GET and http:send-request.

Although I'm not sure why http:GET and http:send-request has been
adding "Connection: close".

--daishi

At Wed, 13 Feb 2008 14:51:15 -0800 (PST),
Elf wrote:
> 
> 
> 
> > OK, since I need partial support for HTTP/1.1,
> > plase do either the followings:
> >
> > a) modify http:POST so that "Connection: close" is added
> >   only if the req is string.
> 
> what if i do a protocol-version check before adding the conenction close, so
> as to preserve proper behaviour under 1.0 ? ie, connection close will only
> be added if there isnt an extant connection header and the version == 1.0.
> 
> 
> > b) modify http:POST and http:GET so that they never
> >   care the Connection header.
> >
> this would break the default behaviour, and is more of a problem with the
> http-client egg as a whole, unfortunately.  http:GET and http:PUT dont 
> pay attention to the attributes, on the whole.  theyre just simplification
> wrappers for everything beneath.  for what its worth, the is-keep-alive? 
> procedure does proper version checking and only closes on the connection 
> header if its explicitly specified, if the protocol-version is 1.1.  so as
> long as i fix the above bit (not explicitly adding the close), it will work
> as you expect in 1.1
> 
> 
> -elf
> 
> **
>  XREA.COM -Free Web Hosting-
>  http://www.xrea.com/
> **


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] proposed change to http-client

2008-02-13 Thread Daishi Kato
At Wed, 13 Feb 2008 08:05:45 -0800 (PST),
Elf wrote:
> oh, i added a utility procedure to take care of those sorts of cases.  if 
> youre reusing a connect, you can now do
>   (http:request-attribute-add! reqobj attribname val) , which will either
> add the attrib if its not there or change the previous val in place (no 
> header reordering) if it already exists.

Yeah, I found it useful. I've been using a similar util procedure
in my local code.

> i was saying that i thought it should always lose connection, but graham 
> pointed out that i was incorrect.  theres a separate issue of 1.0 being 
> default
> though.

OK, since I need partial support for HTTP/1.1,
plase do either the followings:

a) modify http:POST so that "Connection: close" is added
   only if the req is string.
b) modify http:POST and http:GET so that they never
   care the Connection header.

Thanks,
--daishi


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] proposed change to http-client

2008-02-13 Thread Daishi Kato
At Wed, 13 Feb 2008 07:41:06 -0800 (PST),
Elf wrote:
> > Wow, it looks nice.
> > I'm not sure about the type specified is only meaning-full
> > if the content-type was empty. A user might expect the type
> > to be overwritten.
> 
> i didnt think it would be very common for people to be explicitly creating
> the content-type header as part of the headers list (instead of just
> using the type: keyword), so my (perhaps erroneous) thinking was that 
> if they were going to explicitly give content-length as a headers element,
> there would be a reason and they wouldnt be specifying type: as well, and i
> didnt want the default type to then overwrite what was desired.

Hm, probably.
I was thinking of reusing http:request object,
which would be used both for http:GET and http:POST, for example.

> > It would be nice if the handling of Connection: close
> > is consistent with http:POST and http:GET.
> >
> 
> how is it inconsistent?  http posts should close connect afterwards, its not
> a continuable operation, from my understandings.

Here, http:POST overwrite Connection header in req.
I guess correct behavior is of http:GET,
because with HTTP/1.1 the absence of the Connection header
means keep-alive.

Oh, or are you saying that http:POST should ALWAYS close connection?

> > BTW, is the old place
> >  https://galinha.ucpel.tche.br/svn/chicken-eggs/http/trunk
> > obsoleted?
> > (I wan't following this branching issue very well...)
> >i
> 
> 
> no, i just did it in the v3 branch and didnt backport it.  since im using
> v3 and there was pressing need for it to be working, i just did the minimal
> work necessary.  i will backport it if desired (assuming here that the
> changes will not be reverted due to popular demand. :) )

I wish chicken-eggs/http -> chicken-eggs/release/2/http,
but as I said, I wasn't following the issue.

--daishi


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] proposed change to http-client

2008-02-13 Thread Daishi Kato
Wow, it looks nice.
I'm not sure about the type specified is only meaning-full
if the content-type was empty. A user might expect the type
to be overwritten.

It would be nice if the handling of Connection: close
is consistent with http:POST and http:GET.

BTW, is the old place
  https://galinha.ucpel.tche.br/svn/chicken-eggs/http/trunk
obsoleted?
(I wan't following this branching issue very well...)

--daishi

At Wed, 13 Feb 2008 06:56:49 -0800 (PST),
Elf wrote:
> 
> 
> its in the repo at
>   https://galinha.ucpel.tche.br/svn/chicken-eggs/release/3/http/trunk
> or should be at least.
> and if youre using chicken v3, it should be avilable via regular
> chicken-setup within an hour or so, i think.
> 
> 
> -elf
> 
> On Wed, 13 Feb 2008, Daishi Kato wrote:
> 
> > Well, of cource we can remain keyword args.
> > In any case, since we are changing the signature,
> > we can't care about the backward compatibility with more than two args.
> >
> > Where can I look at the new code?
> > I tried to svn up now, only giving me of version 2.1.
> >
> > --daishi
> >
> > At Wed, 13 Feb 2008 06:13:43 -0800 (PST),
> > Elf wrote:
> >>
> >>
> >> oh, also, i didnt say no-one was using the other args, only that no eggs
> >> depended on more than two args.  not many eggs use http-client directly, 
> >> most
> >> use the server.  one of the things im working on needs the client to have
> >> certain functionality atm, though, so at least some of the extra args are
> >> useful.  i added some and took some away.
> >>
> >> -elf
> >>
> >> On Wed, 13 Feb 2008, Daishi Kato wrote:
> >>
> >>> Hi,
> >>>
> >>> I'm one of the guy who messed up the http-client.
> >>> If nobody else is using other than two args,
> >>> why don't we make it much simpler (http:POST req args)
> >>> without keywords?
> >>>
> >>> A user who wants to customize POST method could do so using 
> >>> http:send-request.
> >>>
> >>> --daishi
> >>>
> >>> At Wed, 13 Feb 2008 01:41:52 -0800 (PST),
> >>> Elf wrote:
> >>>>
> >>>>
> >>>> the POST method does not do what would normally be expected, in many 
> >>>> cases.
> >>>> i am proposing to keep the first two args (request/request-server and 
> >>>> args)
> >>>> and to keyword the rest, as well as adding an additional new arg for
> >>>> type (eg xml, form-urlencoded, multipart, etc).  it seems from the code 
> >>>> that
> >>>> this was originally envisioned, and if there are no objections i will
> >>>> implement it immediately.  i will patch any affected eggs as well, 
> >>>> although
> >>>> my grep through the repo shows no egg using more than the first two args.
> >>>> the default will remain application/x-www-form-urlencoded so as not to 
> >>>> break
> >>>> existing apps.
> >>>>
> >>>> thoughts?
> >>>>
> >>>> -elf
> >>>>
> >>>>
> >>>> ___
> >>>> Chicken-users mailing list
> >>>> Chicken-users@nongnu.org
> >>>> http://lists.nongnu.org/mailman/listinfo/chicken-users
> >>>>
> >>>> **
> >>>>  XREA.COM -Free Web Hosting-
> >>>>  http://www.xrea.com/
> >>>> **
> >>>
> >


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] proposed change to http-client

2008-02-13 Thread Daishi Kato
Well, of cource we can remain keyword args.
In any case, since we are changing the signature,
we can't care about the backward compatibility with more than two args.

Where can I look at the new code?
I tried to svn up now, only giving me of version 2.1.

--daishi

At Wed, 13 Feb 2008 06:13:43 -0800 (PST),
Elf wrote:
> 
> 
> oh, also, i didnt say no-one was using the other args, only that no eggs
> depended on more than two args.  not many eggs use http-client directly, most
> use the server.  one of the things im working on needs the client to have
> certain functionality atm, though, so at least some of the extra args are
> useful.  i added some and took some away.
> 
> -elf
> 
> On Wed, 13 Feb 2008, Daishi Kato wrote:
> 
> > Hi,
> >
> > I'm one of the guy who messed up the http-client.
> > If nobody else is using other than two args,
> > why don't we make it much simpler (http:POST req args)
> > without keywords?
> >
> > A user who wants to customize POST method could do so using 
> > http:send-request.
> >
> > --daishi
> >
> > At Wed, 13 Feb 2008 01:41:52 -0800 (PST),
> > Elf wrote:
> >>
> >>
> >> the POST method does not do what would normally be expected, in many cases.
> >> i am proposing to keep the first two args (request/request-server and args)
> >> and to keyword the rest, as well as adding an additional new arg for
> >> type (eg xml, form-urlencoded, multipart, etc).  it seems from the code 
> >> that
> >> this was originally envisioned, and if there are no objections i will
> >> implement it immediately.  i will patch any affected eggs as well, although
> >> my grep through the repo shows no egg using more than the first two args.
> >> the default will remain application/x-www-form-urlencoded so as not to 
> >> break
> >> existing apps.
> >>
> >> thoughts?
> >>
> >> -elf
> >>
> >>
> >> ___
> >> Chicken-users mailing list
> >> Chicken-users@nongnu.org
> >> http://lists.nongnu.org/mailman/listinfo/chicken-users
> >>
> >> **
> >>  XREA.COM -Free Web Hosting-
> >>  http://www.xrea.com/
> >> **
> >


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] proposed change to http-client

2008-02-13 Thread Daishi Kato
Hi,

I'm one of the guy who messed up the http-client.
If nobody else is using other than two args,
why don't we make it much simpler (http:POST req args)
without keywords?

A user who wants to customize POST method could do so using http:send-request.

--daishi

At Wed, 13 Feb 2008 01:41:52 -0800 (PST),
Elf wrote:
> 
> 
> the POST method does not do what would normally be expected, in many cases.
> i am proposing to keep the first two args (request/request-server and args)
> and to keyword the rest, as well as adding an additional new arg for 
> type (eg xml, form-urlencoded, multipart, etc).  it seems from the code that
> this was originally envisioned, and if there are no objections i will
> implement it immediately.  i will patch any affected eggs as well, although
> my grep through the repo shows no egg using more than the first two args.
> the default will remain application/x-www-form-urlencoded so as not to break
> existing apps.
> 
> thoughts?
> 
> -elf
> 
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/chicken-users
> 
> **
>  XREA.COM -Free Web Hosting-
>  http://www.xrea.com/
> **


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] egg documentation

2008-02-13 Thread Daishi Kato
At Tue, 12 Feb 2008 22:46:54 -0500,
John Cowan wrote:
> I'd rather see units and eggs treated as on a par, and the distinction
> drawn between community-supported, author-supported, and unsupported
> packages.

This might work, but isn't it hard to say something is community-supported?
How about "Development Status" in sourceforge.net?

--daishi


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] smtp egg

2008-02-06 Thread Daishi Kato
At Wed, 6 Feb 2008 09:06:12 +0100,
felix winkelmann wrote:
> 
> On Feb 5, 2008 9:42 AM, Daishi Kato <[EMAIL PROTECTED]> wrote:
> >
> > Thanks.
> > But we also need to add flush-output
> > when closing the DATA port.
> > I found it now...
> 
> Sorry, I'm not quite clear about this: wouldn't closing the
> tcp port flush any remaining output automatically?

It's not the tcp port but the port returned by smtp:open.
It must be flushed because "fetch" waits for a response.

Like the following:
 (lambda ()
   (unless bol
 (display "\r\n"))
   (display ".\r\n" (smtp-out smtp))
   (flush-output (smtp-out smtp)) ;; < here
   (fetch smtp)
   (smtp-open-set! smtp #f) ) ) ) )

Daishi


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] smtp egg

2008-02-05 Thread Daishi Kato
At Mon, 4 Feb 2008 14:45:56 +0100,
felix winkelmann wrote:
> 
> On Feb 4, 2008 12:42 PM, Daishi Kato <[EMAIL PROTECTED]> wrote:
> >
> > I've been having another issue,
> > which I finally found out what's going.
> >
> > When I use smtp with (tcp-buffer-size 1000),
> > smtp:connect doesn't work.
> >
> > The solution would be to add flush-output.
> >
> > (define (send smtp fstr . args)
> >   (when (smtp-verbose smtp) (fprintf (current-error-port) "SMTP: ~?~%" fstr 
> > args))
> >   (fprintf (smtp-out smtp) "~?\r\n" fstr args)
> >   (flush-output (smtp-out smtp) )
> >
> 
> Fixed. Thanks again.

Thanks.
But we also need to add flush-output
when closing the DATA port.
I found it now...

Daishi


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] smtp egg

2008-02-04 Thread Daishi Kato
At Fri, 1 Feb 2008 09:42:23 +0100,
felix winkelmann wrote:
> 
> On Feb 1, 2008 7:35 AM, Daishi Kato <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > The example in the page of smtp egg doesn't work.
> > I'd suggest to add a finalizer to the port generated by smtp:open.
> > Or any other solution?
> 
> It is probably easier to simply close the port properly. Sorry for the
> silly mistake - I fixed the example. Thanks for pointing this out.

Thanks a lot, felix.

I've been having another issue,
which I finally found out what's going.

When I use smtp with (tcp-buffer-size 1000),
smtp:connect doesn't work.

The solution would be to add flush-output.

(define (send smtp fstr . args)
  (when (smtp-verbose smtp) (fprintf (current-error-port) "SMTP: ~?~%" fstr 
args))
  (fprintf (smtp-out smtp) "~?\r\n" fstr args)
  (flush-output (smtp-out smtp) )

Daishi


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] smtp egg

2008-01-31 Thread Daishi Kato
Hi,

The example in the page of smtp egg doesn't work.
I'd suggest to add a finalizer to the port generated by smtp:open.
Or any other solution?

Daishi


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] Re: libsvm egg

2008-01-27 Thread Daishi Kato
Hm, since nobody replied,
I should just release it as is.

Is there any intstruction for egg developments?

Thanks,
Daishi

At Sun, 09 Dec 2007 02:07:06 +0900,
Daishi Kato wrote:
> 
> Hi all!
> 
> I made an wrapper egg for libsvm.
> http://www.csie.ntu.edu.tw/~cjlin/libsvm
> 
> It's pretty straightforward based on SWIG,
> but it would be really nice if someone could review it,
> especially around set-finalizer!.
> I'm also sure some objects are not properly freed
> when an error occurs.
> 
> The code is in a svn repo.
> 
> Thanks,
> Daishi


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Web applications

2008-01-17 Thread Daishi Kato
Hi,

Although it is not what you're imagining,
you might have some interests in my project.
Please have a look at the site:
http://w1.nexpiration.jp:1088/waitless/
Two points:
- the server-side code is written in Scheme.
- the server-side code is written using web browsers.

I've never used jQuery, but it looks handy.
I'll give it a try.

Best,
Daishi

At Wed, 16 Jan 2008 18:58:04 +0100,
Tobia Conforto wrote:
> 
> Hello Chicken all-knowers,
> 
> I'm about to design a new, very AJAXy web application and I'd like to  
> write it in Chicken, plus jQuery on the client side.
> 
> What framework/server/storage engine/miscellaneous eggs/deployment  
> tactics do you recommend or have worked with in the past?
> 
> 
> Here's my limited experience.
> 
> I've recently written a simple web forum in Chicken, with just 2  
> presentation cgi scripts (view layer), 1 cgi script to receive the  
> forms (controller layer), 1 "include" file with the database functions  
> (model layer) and another include with miscellaneous utilities.
> I've made use of the excellent sxml-tools egg, the decent cgi-util  
> egg, and sqlite3 for database storage.
> All HTML is generated from s-expressions, using sxml tools.
> The CGI scripts are compiled into binaries and run by Apache.
> 
> This setup has worked very well for this private forum of mine with 10  
> users and 3 cgi pages, but I fear it would not scale well for bigger  
> applications, although I wonder by how much, if anybody has any  
> experience to share.
> 
> 
> I'm going to look into Spiffy next, and the egg repository at large,  
> but I thought I'd ask for your real-world experience before making up  
> my mind.
> 
> 
> Tobia


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] libsvm egg

2007-12-08 Thread Daishi Kato
Hi all!

I made an wrapper egg for libsvm.
http://www.csie.ntu.edu.tw/~cjlin/libsvm

It's pretty straightforward based on SWIG,
but it would be really nice if someone could review it,
especially around set-finalizer!.
I'm also sure some objects are not properly freed
when an error occurs.

The code is in a svn repo.

Thanks,
Daishi


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] unquote in environments

2007-12-06 Thread Daishi Kato
Thanks, John.
I'll find out other workarounds.
--daishi

At Thu, 6 Dec 2007 10:56:19 -0500,
John Cowan wrote:
> 
> Daishi Kato scripsit:
> 
> > How do I expand the quasiquote macro in the environment?
> 
> The trouble is that in Chicken all environments share the same macros,
> so you are stuck with the definition of quasiquote unless you override it
> globally with a version that doesn't invoke ##sys#list or ##sys#cons.
> 
> > I don't want to extend the environment to have ##sys#list.
> > Maybe, extending macroexpand?
> 
> That doesn't help much; it's not the macroexpansion that's at issue,
> it's the eval that's done after calling macroexpand.  That eval
> uses the current (dynamic) environment.
> 
> BTW, Felix, the claim on the wiki that the interaction environment
> can't be extended appears to be false:
> 
> [EMAIL PROTECTED]:~/mpron$ csi
> 
> CHICKEN
> Version 2.736 - linux-unix-gnu-x86  [ manyargs dload ptables applyhook ]
> (c)2000-2007 Felix L. Winkelmanncompiled 2007-10-21 on skunk (Linux)
> 
> #;1> (use environments)
> ; loading /usr/local/lib/chicken/3/environments.so ...
> #;2> foo
> Error: unbound variable: foo
> #;2> (environment-extend! (interaction-environment) 'foo 32)
> #;3> foo
> 32
> 
> -- 
> You let them out again, Old Man Willow! John Cowan
> What you be a-thinking of?  You should not be waking!   [EMAIL PROTECTED]
> Eat earth!  Dig deep!  Drink water!  Go to sleep!
> Bombadil is talking.http://ccil.org/~cowan
> 
> **
>  XREA.COM -Free Web Hosting-
>  http://www.xrea.com/
> **


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] unquote in environments

2007-12-06 Thread Daishi Kato
I see.
Let me ask differently.

#;1> (use environments)
; loading /usr/local/chicken-2.732/lib/chicken/3/environments.so ...
(environment-extend! env 'with-input-from-string with-input-from-string)
#;2> (define env (make-environment))
#;3> (environment-extend! env 'read read)
#;4> (environment-extend! env 'with-input-from-string with-input-from-string)
#;5> (eval '(with-input-from-string "(let ((x 2)) `(1 2 ,x))" read) env)
(let ((x 2)) (quasiquote (1 2 (unquote x

How do I expand the quasiquote macro in the environment?
I don't want to extend the environment to have ##sys#list.
Maybe, extending macroexpand?

Thanks.
Daishi

At Thu, 6 Dec 2007 09:24:37 -0500,
John Cowan wrote:
> 
> Daishi Kato scripsit:
> 
> > Is this an expected behavior? --daishi
> > 
> > CHICKEN
> > Version 2.732 - linux-unix-gnu-x86  [ manyargs dload ptables applyhook 
> > cross ]
> > (c)2000-2007 Felix L. Winkelmanncompiled 2007-12-04 on spirits 
> > (Linux)
> > 
> > #;1> (use environments)
> > ; loading /usr/local/chicken-2.732/lib/chicken/3/environments.so ...
> > #;2> (define env (make-environment))
> > #;3> (eval '(let ((x 2)) `(1 2 ,x)) env)
> > Error: unbound variable: ##sys#list
> 
> Sure.  If you create an empty environment and then invoke macros that
> generate calls to functions not in that environment, errors are exactly
> what you should expect.  In this case, the macro "quasiquote" generates
> calls to the function "##sys#list":
> 
> #;6> (macroexpand '`(1 2 ,x))
> (##sys#list (quote 1) (quote 2) x)
> 
> -- 
> Don't be so humble.  You're not that great. John Cowan
> --Golda Meir[EMAIL PROTECTED]
> 
> **
>  XREA.COM -Free Web Hosting-
>  http://www.xrea.com/
> **


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] unquote in environments

2007-12-06 Thread Daishi Kato
Is this an expected behavior? --daishi

CHICKEN
Version 2.732 - linux-unix-gnu-x86  [ manyargs dload ptables applyhook 
cross ]
(c)2000-2007 Felix L. Winkelmanncompiled 2007-12-04 on spirits (Linux)

#;1> (use environments)
; loading /usr/local/chicken-2.732/lib/chicken/3/environments.so ...
#;2> (define env (make-environment))
#;3> (eval '(let ((x 2)) `(1 2 ,x)) env)
Error: unbound variable: ##sys#list

Call history:

(quote (let ((x 2)) (quasiquote (1 2 (unquote 
x)
  (eval (quote (let ((x 2)) (quasiquote (1 2 (unquote 
x) env)
(let ((x 2)) (quasiquote (1 2 (unquote x
(begin (##sys#list (quote 1) (quote 2) x))
(##sys#list (quote 1) (quote 2) x)
(quote 1)
(quote 2)
  (##sys#list (quote 1) (quote 2) x)  <--


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] RFC: web-unity egg

2007-10-29 Thread Daishi Kato
I see. I didn't realize that part is used.
That said, you are using only a small part of Spiffy, right?
I think I should use the Spiffy backend in any case, though.
--daishi

On 10/29/07, Peter Bex <[EMAIL PROTECTED]> wrote:
> On Mon, Oct 29, 2007 at 09:04:47AM +0900, Daishi Kato wrote:
> > Soulds really cool!
> >
> > One question is why its backend is spiffy, and not http-server.
> > Is it possible to have an additional backend for http-server?
> >
> > --daishi
>
> You could certainly write one, but it would be a bit more work because Spiffy
> already takes care of tracing a path to the requested script and generates
> PATHINFO.  It would be wasteful to duplicate that algorithm in web-unity for
> Spiffy.
>
> Cheers,
> Peter
> --
> http://sjamaan.ath.cx
> --
> "The process of preparing programs for a digital computer
>  is especially attractive, not only because it can be economically
>  and scientifically rewarding, but also because it can be an aesthetic
>  experience much like composing poetry or music."
> -- Donald Knuth
>
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/chicken-users
>
>
>


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] RFC: web-unity egg

2007-10-28 Thread Daishi Kato
Soulds really cool!

One question is why its backend is spiffy, and not http-server.
Is it possible to have an additional backend for http-server?

--daishi

On 10/27/07, Peter Bex <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I just made a new egg called "web-unity".  Its purpose is pretty simple:
> it allows you to create web applications which can run via CGI, SCGI, FCGI
> or Spiffy without having to change the code.  All that's needed is a
> server-specific dispatcher procedure which hands off the request to a
> generic procedure that does the work.
>
> Have a look at its wiki page and try out the egg (available through svn
> only right now), let me know where it can be improved.
>
> Cheers,
> Peter
> --
> http://sjamaan.ath.cx
> --
> "The process of preparing programs for a digital computer
>  is especially attractive, not only because it can be economically
>  and scientifically rewarding, but also because it can be an aesthetic
>  experience much like composing poetry or music."
> -- Donald Knuth
>
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/chicken-users
>
>
>


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] two issues in http egg

2007-10-18 Thread Daishi Kato
Hi,

I filed two tickets for http egg, #311 and #339.
Comments are welcome.

Daishi


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Re: chicken w/ web 2.0 flavor

2007-10-09 Thread Daishi Kato
Hi,

This issue should be fixed by now.
Does this still show Japanese?

http://w1.nexpiration.jp:1088/waitless/100share/filer/filer.html

Thanks!
Daishi

On 10/3/07, Daishi Kato <[EMAIL PROTECTED]> wrote:
> I appreciate to everyone who reported this.
> I can't reproduce the problem with my Japanese browser. (Firefox with
> Japanese locale)
> Looks like it fails to walk through the HTML DOM.
> So, some Japanese characters are removed from the original HTML,
> which might fix the problem.
> Note that JavaScript must be on.
>
> Thanks for your help.
> Daishi
>
> On 10/3/07, Peter Bex <[EMAIL PROTECTED]> wrote:
> > On Wed, Oct 03, 2007 at 08:17:45AM +0900, Daishi Kato wrote:
> > > BTW, did anybody see the Filer on WaitLess in Japanese?
> > > It should show in English by default.
> >
> > I did.  It still shows in Japanese, even though there's a cookie
> > with the name 'language' and value 'English'.
> > There's a dropdown that says 'inline' and 'sub window', though.
> >
> > Peter
> > --
> > http://sjamaan.ath.cx
> > --
> > "The process of preparing programs for a digital computer
> >  is especially attractive, not only because it can be economically
> >  and scientifically rewarding, but also because it can be an aesthetic
> >  experience much like composing poetry or music."
> > -- Donald Knuth
> >
> > ___
> > Chicken-users mailing list
> > Chicken-users@nongnu.org
> > http://lists.nongnu.org/mailman/listinfo/chicken-users
> >
> >
> >
>


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Re: chicken w/ web 2.0 flavor

2007-10-03 Thread Daishi Kato
I appreciate to everyone who reported this.
I can't reproduce the problem with my Japanese browser. (Firefox with
Japanese locale)
Looks like it fails to walk through the HTML DOM.
So, some Japanese characters are removed from the original HTML,
which might fix the problem.
Note that JavaScript must be on.

Thanks for your help.
Daishi

On 10/3/07, Peter Bex <[EMAIL PROTECTED]> wrote:
> On Wed, Oct 03, 2007 at 08:17:45AM +0900, Daishi Kato wrote:
> > BTW, did anybody see the Filer on WaitLess in Japanese?
> > It should show in English by default.
>
> I did.  It still shows in Japanese, even though there's a cookie
> with the name 'language' and value 'English'.
> There's a dropdown that says 'inline' and 'sub window', though.
>
> Peter
> --
> http://sjamaan.ath.cx
> --
> "The process of preparing programs for a digital computer
>  is especially attractive, not only because it can be economically
>  and scientifically rewarding, but also because it can be an aesthetic
>  experience much like composing poetry or music."
> -- Donald Knuth
>
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/chicken-users
>
>
>


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Re: chicken w/ web 2.0 flavor

2007-10-02 Thread Daishi Kato
On 10/3/07, Daishi Kato <[EMAIL PROTECTED]> wrote:
> On 10/3/07, Graham Fawcett <[EMAIL PROTECTED]> wrote:
> > On 10/2/07, Daishi Kato <[EMAIL PROTECTED]> wrote:
> > > Some of you might have interests in my project "WaitLess",
> > > which is a web-based programming platform based on Chicken.
> > > WaitLess lets users build a browser-based application with
> > > JavaScript and Scheme programming languages.
> > > Programming is done in a web browser.
> >
> > Sounds cool, Daishi. Sort of reminds me of Zope, and also of some of
> > the programmable wikis, like Confluence.
> >
> > So, the file-picker app's source code visible through the wiki, then?
>
> Certainly!
>

BTW, did anybody see the Filer on WaitLess in Japanese?
It should show in English by default.

Daishi


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Re: chicken w/ web 2.0 flavor

2007-10-02 Thread Daishi Kato
On 10/3/07, Graham Fawcett <[EMAIL PROTECTED]> wrote:
> On 10/2/07, Daishi Kato <[EMAIL PROTECTED]> wrote:
> > Some of you might have interests in my project "WaitLess",
> > which is a web-based programming platform based on Chicken.
> > WaitLess lets users build a browser-based application with
> > JavaScript and Scheme programming languages.
> > Programming is done in a web browser.
>
> Sounds cool, Daishi. Sort of reminds me of Zope, and also of some of
> the programmable wikis, like Confluence.
>
> So, the file-picker app's source code visible through the wiki, then?

Certainly!


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] Re: chicken w/ web 2.0 flavor

2007-10-01 Thread Daishi Kato
Hi!

Some of you might have interests in my project "WaitLess",
which is a web-based programming platform based on Chicken.
WaitLess lets users build a browser-based application with
JavaScript and Scheme programming languages.
Programming is done in a web browser.
So, it's a wiki-inspired programming platform.
One of the applications is a simple wiki,
and you can try it at:

http://w1.nexpiration.jp:1088/waitless/100share/wiki/sandbox-en/main.html

Another application is Filer/Editor, which is a simple tool for programming.
It is so simple that some of features are missing,
but luckily anybody can modify the Filer/Editor like Wiki.
You could browse all editable files through the Filer at:

http://w1.nexpiration.jp:1088/waitless/100share/filer/filer.html

Unfortunately no good documentation is available,
but questions are welcome.

Hope you like it,
Daishi


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] chicken w/ web 2.0 flavor

2007-10-01 Thread Daishi Kato
Hi!

Some of you might have interests in my project "WaitLess",
which is a web-based programming platform based on Chicken.
WaitLess lets users build a browser-based application with
JavaScript and Scheme programming languages.
Programming is done in a web browser.
So, it's a wiki-inspired programming platform.
One of the applications is a simple wiki,
and you can try it at:

http://w1.nexpiration.jp:1088/waitless/100share/wiki/sandbox-en/main.html

Another application is Filer/Editor, which is a simple tool for programming.
It is so simple that some of features are missing,
but luckily anybody can modify the Filer/Editor like Wiki.
You could browse all editable files through the Filer at:

http://w1.nexpiration.jp:1088/waitless/100share/filer/filer.html

Unfortunately no good documentation is available,
but questions are welcome.

Hope you like it,
Daishi


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Ann: url egg 3.0

2007-06-05 Thread Daishi Kato

Works fine so far.

Thanks for your quick fix.
Daishi

On 6/6/07, Kon Lovett <[EMAIL PROTECTED]> wrote:


On Jun 5, 2007, at 4:23 PM, Daishi Kato wrote:

> Hi,
>
> I think it is important to distinguish the following two:
>  http://1.1.1.1/abc?def
>  http://1.1.1.1/abc?def=

Done. See version 3.3

Best Wishes,
Kon

>
> Thanks,
> Daishi
>



**
 XREA.COM -Free Web Hosting-
 http://www.xrea.com/
**




___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Ann: url egg 3.0

2007-06-05 Thread Daishi Kato

Hi,

I think it is important to distinguish the following two:
 http://1.1.1.1/abc?def
 http://1.1.1.1/abc?def=

Thanks,
Daishi

On 6/6/07, Kon Lovett <[EMAIL PROTECTED]> wrote:


On Jun 5, 2007, at 9:13 AM, Kon Lovett wrote:

>
> On Jun 5, 2007, at 5:18 AM, Daishi Kato wrote:
>
>> Can be anything other than string.
>> Any symbol, or #t?
>> My preference is #t which can be overidden by an optional argument.
>
> Ok.

Umm, not ok. Default is "". When reading it is a string, when
printing it is a string. So '#t' will be encoded on printing. There
is a parameter to override this - 'uri-default-query-value' - it
accepts anything.

Sorry, but #t just isn't a good default. The problem is read/write
invariance.

Query: Should (KEY . "") write as KEY="" or just KEY.

Best Wishes,
Kon

>
>>
> 


**
 XREA.COM -Free Web Hosting-
 http://www.xrea.com/
**




___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


  1   2   3   >