karme | 26 Jan 11:33
Picon

stream question / unbound memory?

Hi,

why does the following example seem to need unbound memory?

sh$ { cat << EOF
#!/bin/sh
#|
GC_PRINT_STATS=1
export GC_PRINT_STATS
exec gosh -- "\$0" "\$@"
|#

(use util.stream)

(define (main args)
  (stream-for-each (lambda(x)
                     (write x)
                     (newline))
                   (port->stream (current-input-port) read))
  0)
EOF
} > test.scm \
&& chmod +x test.scm \
&& seq 10000000\
|./test.scm 2>&1 > /dev/null \
| grep --line-buffered heapsize |cut -f 2 -d ">"

output should be something like:
heapsize = 262144 bytes
heapsize = 786432 bytes
(Continue reading)

Kirill Zorin | 14 Jan 04:52

Thinking again about parameters in the VM

>From private correspondence with Shiro:

"[An] error happens when a parameter is created *after* some
threads are already running, and the parameter is used
in those threads that were already running.  One possible
scenario is like this:

- We have thread A and thread B running.
- Thread A calls (use rfc.http) for the first time.
 This loads http.scm and creates parameters.
 Thread B isn't aware of those parameters.
- Thread B *dynamically* loads some file, say, foo.scm,
 which contains (use rfc.http).  This time http.scm has
 already been loaded, so it's no-op.
- Thread B calls some function defined in foo.scm,
 which in turn makes http call.  The call accesses
 parameters defined in http.scm, but they are not
 visible from B, hence the error.

This won't happen typically, since usually the modules
used by the program is statically stated in `use' form;
so when a thread starts running, all the necessary parameters
are already created.

However, if a module is dynamically loaded (via explicitly
by 'load', or implicitly by autoload), the above scenario
can happen.

[...]

(Continue reading)

Sascha Ziemann | 12 Jan 09:57
Picon

Fwd: SRFI-60 integer->list and list->integer

Gauche list->integer function does not check for negative numbers either:

gosh> (integer->list 0)
()
gosh> (integer->list -1)
()
gosh> (list->integer (integer->list -1))
0

---------- Forwarded message ----------
From: Aubrey Jaffer <agj <at> alum.mit.edu>
Date: 2012/1/10
Subject: Re: SRFI-60 integer->list and list->integer
To: Sascha Ziemann <ceving <at> gmail.com>

 | Date: Tue, 10 Jan 2012 15:56:14 +0100
 | From: Sascha Ziemann <ceving <at> gmail.com>
 |
 | Hello,
 |
 | I have a question about the integer->list function in SRFI-60.
 |
 | The function list->integer does not seem to be the reverse function
 | for integer->list:
 |
 | $ scm
 | > (list->integer (integer->list -1))
 | 0
 |
 | Is this the intended behavior?
(Continue reading)

Sascha Ziemann | 12 Jan 14:10
Picon

copy-bit-field buggy?

The function copy-bit-field from srfi-60 seems to be buggy.

This is what SCM does:

> (number->string (copy-bit-field #b1000 -1 0 3) 2)
"1111"
> (number->string (copy-bit-field #b0000 -1 0 3) 2)
"111"

And this is what Gauche does:
$ gosh -u srfi-60
gosh> (number->string (copy-bit-field #b1000 -1 0 3) 2)
"1000"
gosh> (number->string (copy-bit-field #b0000 -1 0 3) 2)
"0"

------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
Sascha Ziemann | 10 Jan 15:13
Picon

(integer->char -1)

The function integer->char does funny things for -1. This is the
output on my system:

$ gosh
gosh> (integer->char -1)
#\������
gosh>

Is this intended?

------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Gauche-devel mailing list
Gauche-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gauche-devel
obscuroloconato | 22 Dec 10:04

DBI example

First: is this the right mailing list for user questions?

If so:

I tried the DBI example from the reference documentation and get the
following error:

*** ERROR: list required, but got #<<mysql-result-set> 0x9b69fa0>

After some further reading I found the collection framework.

For newbies like me it would be useful to add the use statements at
the top of the example:

(use dbi)
(use gauche.collection)

------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
Shiro Kawai | 21 Dec 06:30
Favicon

Re: unchecked FD_SETSIZE in fdset operations

From: tsugutomo.enami <at> jp.sony.com
Subject: Re: [Gauche-devel] unchecked FD_SETSIZE in fdset operations
Date: Wed, 21 Dec 2011 13:06:14 +0900

> # Of course an interface for another syscall such as poll would be
> # better.

Yeah,
I'm an old-school Unix guy and select(2) was in my toolbox for long time.
That's why sys-select was in Gauche from very early stage.  However
these days it feels rather archaic.   Also the model of select(2)
can't be easiliy emulated on Windows.

I'd like to have event-callback type of API, but unfortunately each
system provides slightly different models.  Using exsiting libraries
to abstract the differences may be an option...

--shiro

------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
Tomas Stanek | 20 Dec 20:16
Picon
Favicon

unchecked FD_SETSIZE in fdset operations

Hi,

code in libsys.scm and port.c uses FD_SET, FD_ISSET and friends on 
fdset. It however doesn't check if the descriptor in question is 
smaller then FD_SETSIZE. This in my case results in a segfault of 
the interpreter. I'm not including the fixing patch because the fix 
is rather trivial.

Best regards,
Tomas Stanek

------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
karme | 6 Nov 17:21
Picon

calling (cgen-precompile scm-file :ext-initializer #t) multiple times

Hi,

using gauche < 0.9.2 i could call
(cgen-precompile scm-file :ext-initializer #t)
multiple times in a row getting expected output

testing with 0.9.2 i found it somehow kept some state (list of modules)

i am not sure wether this is a bug or a feature

as workaround at the moment i use: (maybe shortest explanation to
understand my problem)

;; hackish workaround for bug? in gauche 0.9.2
(when (not (null? (all-tmodules)))
   (class-slot-set! (with-module gauche.cgen.precomp (current-tmodule-class))
                                 'modules
                                 (list)))
(cgen-precompile scm-file :ext-initializer #t)

greetings
karme

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
KISHIMOTO, Makoto | 26 Sep 00:26
Picon
Gravatar

FreeBSD ports upgrade to 0.9.2 patch

Hello, everyone. My name is Makoto Kishimoto.

FreeBSD ports of Gauche is still 0.9, I sent PR already
( http://www.freebsd.org/cgi/query-pr.cgi?pr=160927 ) .

Attached file is patch for upgrade to 0.9.2 . Anyone who use FreeBSD,
please test the patch and comment.

Thank you.
diff -ru ../gauche-0.9/Makefile ./Makefile
--- ../gauche-0.9/Makefile	2011-09-25 08:26:46.000000000 +0900
+++ ./Makefile	2011-09-25 22:46:52.000000000 +0900
@@ -6,7 +6,7 @@
 #

 PORTNAME=	gauche
-PORTVERSION=	0.9	# Keep databases/gauche-gdbm in sync with this
+PORTVERSION=	0.9.2	# Keep databases/gauche-gdbm in sync with this
 CATEGORIES=	lang scheme
 MASTER_SITES=	SF/${PORTNAME}/Gauche/
 DISTNAME=	Gauche-${PORTVERSION}
@@ -48,6 +48,8 @@
 INFO=		gauche-refe gauche-refj
 .endif

+DATADIR=	${PREFIX}/share/${PORTNAME}-0.9
+
 .include <bsd.port.pre.mk>
(Continue reading)

Jens Thiele | 18 Sep 12:54
Picon

sxpath union operator '|'

Hi,

looks like the sxpath union operator '|' doesn't work?

karme <at> amalthea:~/Downloads/scheme/gauche/git/Gauche/src$ ./gosh -ftest
gosh> (use sxml.sxpath)
#<undef>
gosh> ((sxpath "r/a/text()|r/b/text()") '(*TOP* (r (a "hello") (b "world"))))

XPointer parser error: unexpected - "|r/b/text()"
*** ERROR: invalid application: (#f (*TOP* (r (a "hello") (b "world"))))
Stack Trace:
_______________________________________

but txpath.scm has some code to support it?
txpath.scm:
; Parses a UnionExpr production ([18] in XPath specification)
; [18]    UnionExpr    ::=    PathExpr  
;                             | UnionExpr '|' PathExpr
(define (sxml:parse-union-expr path ns-binding)
...

my try on a unit test:

diff --git a/ext/sxml/test.scm b/ext/sxml/test.scm
index b9a39bb..57f8b8c 100644
--- a/ext/sxml/test.scm
+++ b/ext/sxml/test.scm
@@ -23,6 +23,13 @@
   (test* "ns-trans" '((rss:title "foo"))
(Continue reading)


Gmane