Is this the prefered way to use the return values of file-read?
(let-values (((data bytes)) (apply values (file-read fileno size)))
It looks a bit wired. Why does file-read not return values directly if
the language supports them?
___
Chicken-users
This throws an error:
(for-each (lambda (a b)
(printf ~s ~s\n a b))
(list 1 2 3 0)
(list 4 5 6))
But this does not:
(for-each (lambda (a b)
(printf ~s ~s\n a b))
(list 1 2 3)
(list 4 5 6 0))
Is this a bug or feature?
Guile throws
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
2011/9/20 Peter Bex peter@xs4all.nl:
The most important question is: which version of Chicken is this?
There have been massive optimizations done to irregex (the regex
engine used in Chicken) between 4.6.0 and 4.7.0
csi -version reports this:
Version 4.7.0
linux-unix-gnu-x86-64 [ 64bit
2011/9/20 Alan Post alanp...@sunflowerriver.org:
It looks like you have a copy-and-paste error here?
Yes it looks like. But this should be past error bullet proof:
$ for EXT in .pl .scm ; do file ../../bin/grep-domains$EXT ; time
../../bin/grep-domains$EXT | md5sum ; done
2011/9/20 Christian Kellermann ck...@pestilenz.org:
You can add -profile to csc's options. If you need any eggs and
want those profiled too, recompile them also with -profile.
How to do that?
I have installed them with chicken-install. As far as I can see there
are no options to specify
2011/9/20 Daishi Kato dai...@axlight.com:
My guess is that read-line is slower than in perl.
(I think is so optimized in perl.)
Yes this is one reason. I tried this:
$ dd if=/dev/zero bs=1M count=100 | od -xv | cat /dev/null
100+0 records in
100+0 records out
104857600 bytes (105 MB)
2011/9/20 Sascha Ziemann cev...@gmail.com:
$ dd if=/dev/zero bs=1M count=100 | od -xv | cat.scm /dev/null
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 36.9156 s, 2.8 MB/s
With cat.scm being this:
#! /usr/local/bin/csi -s
(let next-line ((line (read-line
What the hell does write-line do?
I used this script:
#! /usr/local/bin/csi -s
(define (write-line* line)
(display line)
(newline))
(if (not (null? (command-line-arguments)))
(set! write-line write-line*))
(let next-line ((line (read-line)))
(if (not (eof-object? line))
(begin
2011/9/21 Christian Kellermann ck...@pestilenz.org:
On a second thought, here is what write-line does:
(define write-line
(lambda (str . port)
(let ((p (if (##core#inline C_eqp port '())
##sys#standard-output
(##sys#slot port 0) ) ) )
2011/9/21 Christian Kellermann ck...@pestilenz.org:
I prefer improvement.
Btw this is what Bigloo does.
Interpreted:
$ dd if=/dev/zero bs=1M count=100 | od -xv | bigloo -i cat.scm /dev/null
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 10.6036 s, 9.9 MB/s
Compiled with
The documentation for find-files says: By default, symbolic links are
not followed.
Try this:
$ ln -s this .
$ csi -R posix -e '(write (find-files .))'
$ csi -v
CHICKEN
(c)2008-2011 The Chicken Team
(c)2000-2007 Felix L. Winkelmann
Version 4.7.0
linux-unix-gnu-x86-64 [ 64bit manyargs dload
2011/9/21 Christian Kellermann ck...@pestilenz.org:
A workaround is to explicitly specify follow-symlinks: #f in your
call to find-files. Does that help you for now?
Of course. To be precise: I don't need it at all, because my data does
not have any symlinks. I tried it only out of spite. ;-)
The documentation for the thread-sleep! function in the srfi-18
documentation mentions a function called current-time. But that can
not be found:
http://wiki.call-cc.org/search?text=ident=current-time
___
Chicken-users mailing list
I am running the following test on Red Hat Enterprise Linux Server
release 6.3 (Santiago):
$ uname -m
x86_64
$ getconf LONG_BIT
64
$ cat crash.scm
#! /usr/xxx/bin/csi -s
(use syslog)
(openlog #f opt/pid facility/local0)
$ csi crash.scm
CHICKEN
(c)2008-2011 The Chicken Team
(c)2000-2007 Felix
I tried to pass a list to amb but I do not know how to use amb-thunks. I
tried this:
(require-extension amb)
(let ((names '(a b c)))
(amb-collect
(let ((name (amb-thunks (map (lambda (x) x) names)))
(value (amb 'c 'b 'a)))
(amb-assert (eq? name value))
value)))
(let
Hi,
I have a simple program using the blowfish egg in a macro to do some
obscurity:
(require-extension blowfish)
(define-syntax curtain
(ir-macro-transformer
(lambda (form inject compare?)
(let* ((str (cadr form))
(len (string-length str))
(pad (make-string
2014-10-06 15:53 GMT+02:00 Peter Bex peter@xs4all.nl:
On Mon, Oct 06, 2014 at 03:44:38PM +0200, Sascha Ziemann wrote:
Error: during expansion of (curtain ...) - unbound variable:
blowfish#make-blowfish-encryptor
You can do (begin-for-syntax (require-extension blowfish)) to make
Hi,
Chicken prints non printable characters in its call history:
syntax (string-blob405 �x\x1e�`�ռ�UF���~F)
My terminal crashed just because of this.
Is it the intended behavior? Or can I change this by myself?
Regards,
Sascha
___
Hi,
I have a small program talking XML-RPC over HTTPS. When I run it with csi
it works fine:
$ csi -s domrobot.scm 127.0.0.1
Record updated.
But when I try the compiled version I get an error:
$ csc domrobot.scm
$ ./domrobot 127.0.0.1
Error: (ssl-connect) Unable to connect over HTTPS. To fix
2014-10-07 13:45 GMT+02:00 Christian Kellermann ck...@pestilenz.org:
* Sascha Ziemann cev...@gmail.com [141007 13:37]:
The binary is not linked against Openssl:
$ ldd domrobot
linux-gate.so.1 = (0xb7793000)
libchicken.so.6 = /usr/lib/libchicken.so.6 (0xb7402000
2014-10-07 13:48 GMT+02:00 Peter Bex peter@xs4all.nl:
You'll need to ensure that openssl is available to the application.
Like the error message says, all you need to do is ensure that it's
installed and it'll work. If you're using -deploy, make sure that you
add the egg to your
2014-10-07 14:28 GMT+02:00 Kristian Lein-Mathisen kristianl...@gmail.com:
which CHICKEN version are you using?
It is the one which comes with Debian stable: 4.7.0-1
There is a bug in some older versions where you need to specify (use
chicken-syntax) for it work in compiled modules. Does
2014-10-07 15:23 GMT+02:00 Christian Kellermann ck...@pestilenz.org:
If you can please consider upgrading, 4.7.0 is horribly out of date
and tons of bugs have been fixed in the meantime.
With the two non obvious lines:
(use chicken-syntax)
(begin-for-syntax (require-extension blowfish))
Hi,
is it possible to use a Chicken 3 egg like the the SMTP client in
Chicken 4? I can not find the SMTP client in the version 4 eggs.
Regards,
Sascha
___
Chicken-users mailing list
Chicken-users@nongnu.org
Hi,
what is the Chicken equivalent of Java's File.separator
http://docs.oracle.com/javase/8/docs/api/java/io/File.html#separator
and File.pathSeparator:
http://docs.oracle.com/javase/8/docs/api/java/io/File.html#pathSeparator
Something like this maybe:
(use posix)
(define file-separator
Hi,
I have a problem with Sxpath not preserving the node order.
This example:
(use regex)
(use http-client)
(use sxpath)
(use html-parser)
((sxpath //h1[@class='header']//*/text())
(with-input-from-request
http://www.imdb.com/title/tt0497465/;
#f html-sxml))
returns
It seems to me that the use of //* duplicates the inner 'a' node:
(begin
(newline)
(pp ((sxpath //h1[@class='header']//*)
(with-input-from-request
http://www.imdb.com/title/tt0497465/;
#f html-sxml
prints
((span (@ (class itemprop) (itemprop name)) Vicky Cristina
Hi,
what is the easiest way, when using Chicken on Windows, to convert a
UTF-8 string to UTF-16?
It seems to me that rename-file needs UTF-16 encoded strings on Windows.
Regards,
Sascha
___
Chicken-users mailing list
Chicken-users@nongnu.org
At Fri, 05 Dec 2014 11:55:39 +0100,
Jörg F. Wittenberger wrote:
Am 04.12.2014 um 21:25 schrieb Sascha Ziemann:
It seems to me that the use of //* duplicates the inner 'a' node:
That's not what it does. I'm not completely sure that XPath does
require this behavior, but I tend to believe
Hi,
How to tell csc to call main in the same way like csi -ss?
$ cat distribution.scm
#! /usr/bin/csi -ss
(define (main args)
(display main\n))
$ ./distribution.scm
main
$ csc distribution.scm
$ ./distribution
$
csc does not seem to have a -ss option.
Regards,
Sascha
Hi,
I tried to play a bit with ARM assembler, but reading 4 byte from a port
seems to be quite hard with Chicken.
Why are 32 bits inexact?
(exact? #b1000) - #f
What is the easiest way to read a 32 bit word in a looseless way from a
port?
Regards,
Sascha
Hello,
the solution setting INSTALL_PROGRAM works fine for me.
Regards,
Sascha
-- Forwarded message --
From: Michele La Monaca mikele.chic...@lamonaca.net
Date: 2015-03-13 21:18 GMT+01:00
Subject: Re: [Chicken-users] Chicken on Solaris
To: Sascha Ziemann cev...@gmail.com
Hi
I tried to install Chicken on Solaris. Compilation works fine but
installation fails:
$ gmake PLATFORM=solaris PREFIX=$HOME/chicken install
gmake -f ./Makefile.solaris CONFIG= install
gmake[1]: Entering directory `/export/home/x/chicken-4.9.0.1'
install -d -m 755 /export/home/x/chicken/lib
I have the following macro:
(define-syntax define-facts
(syntax-rules ()
((_ (name a0 a1 ...) ((v00 v01 ...) (v10 v11 ...) ...))
'(define (name a0 a1 ...)
(conde
((== a0 v00) (== a1 v01) ...)
((== a0 v10) (== a1 v11) ...)
...)
In Guild 2.0.9
2017-03-10 10:55 GMT+01:00 Peter Bex :
>
> Gauche and Racket accept this macro application, Scheme48 rejects it (but
> that's expected, because our syntax-rules is originally from Scheme48).
>
But Gauche fails like Chibi. They silently ignore the last ellipsis.
$
36 matches
Mail list logo