Re: read-string!/partial on non-file ports

2007-09-10 Thread Kevin Ryde
Mike Gran [EMAIL PROTECTED] writes: I wrote a peer-to-peer ap where I used (display data socket) to send and (read-string!/partial block socket-port) to receive. That'd be the ticket, I use a `socketpair' and read-string to talk back and forward to a child process. You have to have an ugly

Re: (fcntl fd F_GETLK ...) from Guile

2007-09-01 Thread Kevin Ryde
Kaloian Doganov [EMAIL PROTECTED] writes: I need to do record (range) locking, not whole-file locking, and I hoped to do it with Guile. If you don't mind breaking out a little C code it shouldn't be too hard. (I can never remember which types of locks are voluntary or mandatory, and which

Re: What is best way to limit memory alloc?

2007-08-31 Thread Kevin Ryde
Roland Orre [EMAIL PROTECTED] writes: What is the best way to limit the memory allocation in guile? Perhaps setrlimit would be the most reliable overall. I'm still running 1.7 as I haven't got the time and energy to change the array implementation yet. I struck a bug lately in 1.8 where the

Re: Using guile's introspection facilities

2007-02-28 Thread Kevin Ryde
Daniel Ridge [EMAIL PROTECTED] writes: SCM_DEFINE(guile_srcprops_p, srcprops?, 1, 0, 0, I don't think that's meant to be visible, merely a compact form of what's normally prsented as an alist. If you want a test then one possibility would be that it automagically shows up in goops as a

Re: SLIB fails to load features

2007-02-11 Thread Kevin Ryde
Alex Gittens [EMAIL PROTECTED] writes: guile (probably-prime? 13) unnamed port: In expression (probably-prime? 13): unnamed port: Unbound variable: probably-prime? Is it called `prime?' rather than `probably-prime?' ? ___ Guile-user mailing list

Re: timezone offsets

2007-01-29 Thread Kevin Ryde
[EMAIL PROTECTED] (clemens fischer) writes: i just checked guile-1.8.1/libguile/stime.c, which doesn't have this patch, I applied Aaron VanDevender's prior one. $ guile -c '(display (strftime %c %z\n (localtime (current-time' Mon Jan 29 19:31:28 2007 -0100 I believe it's in 1.8.1,

Re: Gmp now working, but number.c:147 isinf declared implicitly.

2007-01-26 Thread Kevin Ryde
Hugh Sasse [EMAIL PROTECTED] writes: I didn't invoke automake myself, I was just disclosing the toolset. Does it get fired off by autoreconf? It provides some of the macros used in generating the configure script. ___ Guile-user mailing list

Re: Gmp now working, but number.c:147 isinf declared implicitly.

2007-01-21 Thread Kevin Ryde
Hugh Sasse [EMAIL PROTECTED] writes: -AC_INIT(m4_esyscmd(. ./GUILE-VERSION echo -n ${PACKAGE}), -m4_esyscmd(. ./GUILE-VERSION echo -n ${GUILE_VERSION})) +define(GUILE_PACKAGE_NAME,m4_esyscmd(. ./GUILE-VERSION ${ECHO_N} ${PACKAGE})) +define(GUILE_PACKAGE_VERSION,m4_esyscmd(.

Re: Gmp now working, but number.c:147 isinf declared implicitly.

2007-01-21 Thread Kevin Ryde
I made this change: --- configure.in.~1.268.2.28.~ 2006-12-27 10:32:04.0 +1100 +++ configure.in 2007-01-22 10:03:13.0 +1100 @@ -27,8 +27,15 @@ AC_PREREQ(2.53) -AC_INIT(m4_esyscmd(. ./GUILE-VERSION echo -n ${PACKAGE}), -m4_esyscmd(. ./GUILE-VERSION echo -n

Re: about usage of `sigaction'

2007-01-21 Thread Kevin Ryde
William Xu [EMAIL PROTECTED] writes: Currently it just makes me feel uncomfortable when it doesn't work as expected.. I hope someday it could get fixed. I'll add something like the following to the manual for a start, to at least describe how it works now ... Scheme code signal

Re: about usage of `sigaction'

2007-01-18 Thread Kevin Ryde
William Xu [EMAIL PROTECTED] writes: So all other things are blocked during accept()? Signals for the thread in question at least :(. Maybe this is a problem of scheme accept? It's not a good thing, though fixing it might be tricky. Do you actually need to know immediately the child exits?

Re: Gmp now working, but number.c:147 isinf declared implicitly.

2007-01-18 Thread Kevin Ryde
Hugh Sasse [EMAIL PROTECTED] writes: ./.libs/libguile.so: undefined reference to `isinf' At which point I am now stuck. After all, configure found isinf. You might be able to stick something in to save the conftest.c used. Or maybe it's no more than #include math.h int main

Re: about usage of `sigaction'

2007-01-17 Thread Kevin Ryde
William Xu [EMAIL PROTECTED] writes: i wrote a simple echo server/client. To catch SIGCHLD signal, i install a signal handler before first `connect'. The problem is that when the client exits, the handler seems not called. I expect you've checked with ps that the child has actually exited.

Re: Gmp now working, but number.c:147 isinf declared implicitly.

2007-01-17 Thread Kevin Ryde
Hugh Sasse [EMAIL PROTECTED] writes: putenv putenv (3c) - change or add value to environment The manual page says it should be of the form name=value and the string should not be automatic. In a function it should be declared static. Yep. I believe there's a bit of variation

Re: Gmp now working, but number.c:147 isinf declared implicitly.

2007-01-15 Thread Kevin Ryde
Hugh Sasse [EMAIL PROTECTED] writes: posix.c: In function 'scm_putenv': posix.c:1332: error: 'len' undeclared (first use in this function) Thanks. Dodgy conditionals :-(. You can use the len at the start of the function (claiming to be for mingw). Does that mean there's no unsetenv() on

Re: Gmp now working, but number.c:147 isinf declared implicitly.

2007-01-12 Thread Kevin Ryde
Hugh Sasse [EMAIL PROTECTED] writes: cc1: warnings being treated as errors That's designed to force all users to be developers :-(. numbers.c: In function 'xisinf': numbers.c:147: warning: implicit declaration of function 'isinf' You might be able to just stick in a prototype, or

Re: alloca bug

2007-01-01 Thread Kevin Ryde
Neil Jerram [EMAIL PROTECTED] writes: In the meantime, can we fix this for guile by just adding #ifndef alloca around the whole blob? Would that have bad effects on other OSs? Sounds good. ___ Guile-user mailing list Guile-user@gnu.org

Re: guile gnome gdk bindings question...no threads_init, threads_enter and threads_exit definitions

2006-12-18 Thread Kevin Ryde
Stan Pinte [EMAIL PROTECTED] writes: http://aruiz.typepad.com/siliconisland/2006/04/threads_on_pygt.html I suppose a dynamic-wind for the enter/leave would ensure a leave if there was an error in the protected section. My problem is that I cannot find anywhere a guile module containing these

Re: Anyone having guile binding for libiconv or librecode?

2006-12-15 Thread Kevin Ryde
, the only bits I was needing was to and from the locale charset, so an iconv_t for each direction can be kept open. The occasional arbitrary charset-utf8 just does a new iconv_open every time. (On glibc that runs pretty fast.) /* Chart miscellaneous C code. Copyright 2003, 2005, 2006 Kevin Ryde

Re: iota from SRFI-1

2006-12-12 Thread Kevin Ryde
[EMAIL PROTECTED] writes: It looks like the iota function from ice-9/boot-9.scm is called. It took a while, but I made a fix for the next release. ___ Guile-user mailing list Guile-user@gnu.org http://lists.gnu.org/mailman/listinfo/guile-user

Re: alloca bug

2006-12-07 Thread Kevin Ryde
Jon Wilson [EMAIL PROTECTED] writes: scmconfig.h seems to only be created while make all is running (try make scmconfig after ../configure). Yes, it's generated. However, on my system, and Gopi's FreeBSD system as well, scmconfig.h includes stdlib.h. So, indirectly, eval.c includes

Re: iota from SRFI-1

2006-10-11 Thread Kevin Ryde
[EMAIL PROTECTED] writes: rlwrap guile181 --use-srfi=1 guile (iota 3 1) Backtrace: In standard input: 1: 0* [iota 3 1] standard input:1:1: In procedure iota in expression (iota 3 1): standard input:1:1: Wrong number of arguments to #procedure iota (n) ABORT: (wrong-number-of-args)

Re: readline eats previous text on line

2006-10-05 Thread Kevin Ryde
Neil Jerram [EMAIL PROTECTED] writes: Good point. I believe Jon's going to raise this (inability to do readline starting from the column after the prompt) with the readline people. I see there's an rl_already_prompted, though you still have to tell it the prompt string to make redisplay

Re: readline eats previous text on line

2006-10-04 Thread Kevin Ryde
This is what I ended up checking-in. 6.5.3 Readline Functions The following functions are provided by (use-modules (ice-9 readline)) There are two ways to use readline from Scheme code, either make calls to `readline' directly to get line by line input, or use

Re: readline eats previous text on line

2006-10-02 Thread Kevin Ryde
I wrote: ... some words for the manual. What else should be described? Extra options to `readline' for the input/output ports, or is that only meant for the %readline level and only set-readline-input-port! for the high level? (readline-port) create/return the readline port? Is it possible

Re: readline eats previous text on line

2006-09-27 Thread Kevin Ryde
Jon Wilson [EMAIL PROTECTED] writes: This prints prompt: on a line, and then after a short time, it is erased. It might be as simple as (readline foo: ) Not sure if that's meant to be documented, seems like a pretty sensible usage, even if reading current-input-port might be usual.

Re: Need help finding heap corruption bug

2006-09-18 Thread Kevin Ryde
Pat Lasswell [EMAIL PROTECTED] writes: It seems that char 254 doesn't behave as expected in regular expressions on this platform. Trying all bytes is probably bogus in a multibyte locale, but if we're still in C locale at that point then it ought to work. (Maybe should force (setlocale C)

Re: Exception API

2006-09-04 Thread Kevin Ryde
[EMAIL PROTECTED] (Ludovic Courtès) writes: (let ((errno (car (cadddr args ;; !!! system-error-errno helps there. I made a few similar extracting funcs at one time ... then found it better not to try to be too smart about analysing errors! (guard (c ((i/o-no-such-file-error? c)

Re: acosh, getting consistent results from GSL and Guile

2006-08-20 Thread Kevin Ryde
Daniel Llorens del Río [EMAIL PROTECTED] writes: Myself, I'd be happy if only things like this didn't happen: guile (tanh 1e3+i) +nan.0 Perhaps the libc ctanh() etc could be used when available ... let somebody else worry about overflows. ___

Re: Garbage collection bug

2006-08-01 Thread Kevin Ryde
Andreas Røsdal [EMAIL PROTECTED] writes: When the cards get dragged the list of cards is kept purely on the C side of the code - hence there is an opportunity for them to get garbage collected. Do you mean the CallData bits of cscmi_drag_valid and friends in cscmi.c? Yes, they look a bit

Re: undocumented function repl

2006-08-01 Thread Kevin Ryde
Jon Wilson [EMAIL PROTECTED] writes: There seem to be a number of repl related procedures that are exported. Should all of them be available? Probably not. There's a fair bit of stuff in boot-9 that ought to either made private or documented. ___

Re: gh_ to scm_ manual bug

2006-07-23 Thread Kevin Ryde
Jon Wilson [EMAIL PROTECTED] writes: scm_c_primitive_load ... scm_c_eval_string Thanks, I added them. ___ Guile-user mailing list Guile-user@gnu.org http://lists.gnu.org/mailman/listinfo/guile-user

Re: testing arity

2006-07-23 Thread Kevin Ryde
Neil Jerram [EMAIL PROTECTED] writes: And if you're not keen on parsing arity's output, see its definition in (ice-9 session) for the procedure properties that it queries to produce this. (procedure-property obj 'arity) being the operative part, it gives a list of (required-count

Re: Reverting eqv? behavior for signed zeros and nans to 1.6 semantics

2006-07-18 Thread Kevin Ryde
Per Bothner [EMAIL PROTECTED] writes: | From: Marius Vollmer [EMAIL PROTECTED] | Specifically, 'eqv?' would be changed to return '#t' when comparing | negative and positive zero: | | (eqv? 0.0 -0.0) = #t I missed the explanation for why this might be desirable. Primarily for

Re: guile -1.8.0 on AIX 64 bit

2006-06-14 Thread Kevin Ryde
m.vaessen [EMAIL PROTECTED] writes: libtool: link: not configured to extract global symbols from dlpreopened files You might get a better answer on the libtool list for what that means. xlc_r -q64 -o .libs/guile -D_THREAD_SAFE guile-guile.o -L/usr/local/lib -L./.libs -lguile -lpthreads

Re: SRFI-9 and `equal?'

2006-06-08 Thread Kevin Ryde
[EMAIL PROTECTED] (Ludovic Courtès) writes: What was the reason to not have `list-equal?'? Was it the fact that we want it to be inlined within `equal?'? You should hide it please. I think different equality test funcs are generally exposed only when they do something different from plain

Re: SRFI-9 and `equal?'

2006-06-06 Thread Kevin Ryde
[EMAIL PROTECTED] (Ludovic Courtès) writes: According to R5RS, if the two `chbouib' instances print equally, they should be `equal?'. I don't think that's meant to be taken literally, I'm pretty sure what it's only trying to say is that `equal?' recurses into containers like lists and vectors.

Re: Compile issues for 1.8.0 on Solaris 10

2006-06-06 Thread Kevin Ryde
Charles Gagnon [EMAIL PROTECTED] writes: struct dirent ent; SCM_SYSCALL (readdir_r ((DIR *) SCM_CELL_WORD_1 (port), ent)); I'm not sure that'll work, struct dirent can be small, hence the union with the bigger amounts. If you're using that function you might be better just putting

Re: potential memory leak in do loop

2006-05-03 Thread Kevin Ryde
stephane chatigny [EMAIL PROTECTED] writes: Does a Unix command like pmap PID could help me to determine if there is a memory leak in the process? I suppose. I only ever look at top to see if it's going up. ___ Guile-user mailing list

Re: passing flags to a function

2006-05-02 Thread Kevin Ryde
Dan McMahill [EMAIL PROTECTED] writes: SCM scm_myfn(SCM flags) { myfn (scm_num2int (flags, SCM_ARG1, myfn)); Various things in the guile core are done like that, stuff like O_RDWR for `open'. The list of symbols Ludovic described is done in the guile-gtk interface and works nicely too. If

Re: potential memory leak in do loop

2006-05-02 Thread Kevin Ryde
Stephane Chatigny [EMAIL PROTECTED] writes: (although I have not tracked the memory usage yet). You'll probably have to use one of the various malloc debugging packages to find who has allocated the memory that's never freed, to see who's supposed to be responsible for that.

Re: searching: example of C extension implementing port

2006-03-07 Thread Kevin Ryde
Marco Maggi [EMAIL PROTECTED] writes: is there a sample extension implementing an input/output channel? You'll have seen the Soft Ports node in the manual, it's pretty straightforward. I'm thinking of a memory channel (not an interface to a file or hardware port), something like the string

Re: How to process stdin with Guile

2006-03-07 Thread Kevin Ryde
Torsten Bronger [EMAIL PROTECTED] writes: 1) Will the result from scm_from_locale_string() garbage-collected cleanly? Yep. My concern is that the program should be able to read from stdin, too, and I question the protability of the file name /dev/stdin.

Re: scm_ documentation

2006-02-25 Thread Kevin Ryde
Jon Wilson [EMAIL PROTECTED] writes: Everything in this email still applies to 1.6, however. Alas the 1.6 manual hasn't been getting updates, not beyond the level of fixing outright errors. I actually intended to mean that the gh_ to scm_ section was not a very complete documentation of the

Re: slib and scm_shell() conflicts

2006-02-20 Thread Kevin Ryde
William Xu [EMAIL PROTECTED] writes: I have attached a reproducible testcase, It works ok for me, unfortunately (on i386 with gcc 2.95). ___ Guile-user mailing list Guile-user@gnu.org http://lists.gnu.org/mailman/listinfo/guile-user

Re: Guile 1.7.91 has been released.

2006-02-13 Thread Kevin Ryde
[EMAIL PROTECTED] (Han-Wen Nienhuys) writes: ## Remove fileblocks.o from the object list. This file gets added by ## the Autoconf macro AC_STRUCT_ST_BLOCKS. But there is no need. #LIBOBJS=`echo ${LIBOBJS} | sed 's/fileblocks\.o//g'` Actually, the bit preceding that seems relevant, ##

Re: doc bug: object property `name'

2006-02-13 Thread Kevin Ryde
Jon Wilson [EMAIL PROTECTED] writes: But I can't find any way to get at that `name' property. Not that I need to, I'm just curious. `procedure-name', which is separate from those object property bits. the phrase identifying it should be removed from the manual, Thanks, I'll do that.

Re: charset conversion

2006-02-12 Thread Kevin Ryde
Christian Mauduit [EMAIL PROTECTED] writes: (_ my string) Gettext can understand that directly, actually. With a recent version it's something like xgettext --language=scheme --keyword=_ With older gettext I think language=lisp works. xgettext recognises `gettext' calls directly,

Re: charset conversion

2006-02-09 Thread Kevin Ryde
William Xu [EMAIL PROTECTED] writes: Does guile support charset conversion? e.g., Display a string using my-charset coding system, The short answer is no. Strings are just byte sequences, which is ok if your input and output codings are the same, but needs an add-on if you have to convert. I

Re: Another load path idea

2006-01-28 Thread Kevin Ryde
[EMAIL PROTECTED] (Ludovic Courtès) writes: (i) a config file holding the default value of `%load-path', If you really want to add something, just load an /etc/guilerc at startup. That'd be all the flexibility and wouldn't force add-on modules to jump through hoops (not until the hoops are

Re: Another load path idea

2006-01-26 Thread Kevin Ryde
Neil Jerram [EMAIL PROTECTED] writes: The basic scenario is this: someone has Guile installed (probably by their distro) in /usr, and then builds and installs an additional package using ./configure make sudo make install, which installs with a different prefix than /usr (usually

Re: new slib and guile 1.6.7

2005-10-30 Thread Kevin Ryde
Greg Troxel [EMAIL PROTECTED] writes: If all modules inherit from guile-user, then that sounds right. But this would expose slib's require machinery to all guile programs, even those that haven't asked for it, and that's not good. I'm unsure if it would work any other way (ie. non-globally).

Re: new slib and guile 1.6.7

2005-10-29 Thread Kevin Ryde
Greg Troxel [EMAIL PROTECTED] writes: Whether there is something deeper with gnucash, I don't know, but I have no reason to think so yet. I wondered if perhaps ice-9 slib was supposed to be like a proper module, giving an slib environment only in those application modules using it, and not

Re: new slib and guile 1.6.7

2005-10-28 Thread Kevin Ryde
Greg Troxel [EMAIL PROTECTED] writes: I believe this should be fixed for 1.6.8; breaking slib breaks gnucash. Ah. Do we have someone from the gnucash world who can say what it should look like or how it should work? ___ Guile-user mailing list

Re: make: don't know how to make CFLAGS. Stop

2005-10-28 Thread Kevin Ryde
Mike Gran [EMAIL PROTECTED] writes: numbers.lo: CFLAGS := $(filter-out -Werror,${CFLAGS}) That's not too flash is it. FWIW, this affects AIX as well, and is still present in Guile-1.6.8-rc0. If Rob agrees I'd reckon it could be removed. -Werror isn't in a default build anyway.

Re: Socket API improvement, patch #6

2005-10-28 Thread Kevin Ryde
[EMAIL PROTECTED] (Ludovic Courtès) writes: I'd just suggest the following patch. Beaut, I gave it a bit of a tweak and applied it. (Incidentally, I'm sure this whole thread belongs on guile-devel, not guile-user.) ___ Guile-user mailing list

Re: Socket API improvement, patch #6

2005-10-26 Thread Kevin Ryde
Ok, we got there eventually. I checked it in, and I updated the docs (have a read to see it they look right). I want to give the docs a bit more polish, on the various constants and the address endianness for a start, so don't worry if they're not yet tip-top.

Re: Managing Guile and extensions versions

2005-10-11 Thread Kevin Ryde
Vorfeed Canal [EMAIL PROTECTED] writes: now what I need to do to install guile 1.8.1 as /usr/bin/guile-1.8.1 and guile 1.8.2 as /usr/bin/guile-1.8.2 Install under different $prefix. Where configure.ac/Makefile.am should put libmysuperextension.la (+ .so, etc) file ? Under the $prefix of

Re: Managing Guile and extensions versions

2005-10-08 Thread Kevin Ryde
Vorfeed Canal [EMAIL PROTECTED] writes: GUILE=/myexperiments/guile/bin/guile \ GUILE_CONFIG=/myexperiments/guile/bin/guile-config \ GUILE_TOOLS=/myexperiments/guile/bin/guile-tools \ I would set the PATH, this probably works though. $ /myexperiments/guile/bin/guile -c '(use myextension

Re: Managing Guile and extensions versions

2005-10-01 Thread Kevin Ryde
[EMAIL PROTECTED] (Ludovic Courtès) writes: In fact, Libtool's versioning mechanism already makes this possible for programs: the loader and/or dynamic linker chooses the one version of the library the program expects to be linked against. Oh, well, libtool only wraps what ld.so does, but

Re: Exposing common type wrapping/unwrapping methods

2005-09-28 Thread Kevin Ryde
[EMAIL PROTECTED] (Ludovic Courtès) writes: [AF_INET...] + c_address = scm_malloc (sizeof (struct sockaddr_in)); + c_inet = (struct sockaddr_in *)c_address; + + c_inet-sin_addr.s_addr = + htonl (scm_to_ulong (SCM_SIMPLE_VECTOR_REF (address, 1))); Looks

Re: PHP to GUILE

2005-09-25 Thread Kevin Ryde
Vorfeed Canal [EMAIL PROTECTED] writes: 1. All C extension files can only be put in /usr/lib - there are no sane way to change libtool's searchpath and there are no sane default. Very annoying. With a full path to `load-extension' you can put a module anywhere. If your code is a package in

Re: Exposing common type wrapping/unwrapping methods

2005-09-22 Thread Kevin Ryde
[EMAIL PROTECTED] (Ludovic Courtès) writes: Regarding `sendto', I tested it informally as follows: An AF_UNIX socket can probably exercise that. I didn't test IPv6 stuff Something using localhost would be good. I thought at one stage to add IN6ADDR_LOOPBACK or something as a constant to

Re: Exposing common type wrapping/unwrapping methods

2005-09-21 Thread Kevin Ryde
[EMAIL PROTECTED] (Ludovic Courtès) writes: Again, I only tested AF_INET addresses and I didn't try `sendto' and `bind'. Untested code cannot be accepted. AF_UNIX is easy, AF_INET6 might depend on the system. You'll need to make something for test-suite/tests/socket.test exercising each

Re: Threads in 1.6.4 hanging: caused by accept?

2005-09-15 Thread Kevin Ryde
Alan Grover [EMAIL PROTECTED] writes: What would be the comprehensive list of calls that block all threads? How do you figure that out? `gethost' is a bad one, it disappears deep into libc so select or whatever doesn't help. I ended up forking a subprocess to make the call. Or I guess

Re: The order of objects returned from a guardian

2005-08-01 Thread Kevin Ryde
Marius Vollmer [EMAIL PROTECTED] writes: There is no guarantee about the order in which objects are returned from a guardian. If you want to impose an order on finalization actions, for example, you can do that by keeping objects alive in some global data structure until

Re: About removing the low level thread API

2005-04-18 Thread Kevin Ryde
Marius Vollmer [EMAIL PROTECTED] writes: On the other hand, Guile itself both works on systems that do provide a pthread API, and on systems that do not. C code written for Guile might want to support both cases as well (being properly thread safe by default, but still compilable even when

Re: xgettext -L Scheme

2005-04-15 Thread Kevin Ryde
David Pirotte [EMAIL PROTECTED] writes: am I missunderstanding something here? I had to add --keyword=_ to xgettext when using _ as an alias for gettext. Dunno if that's meant to be builtin. ___ Guile-user mailing list Guile-user@gnu.org

Re: Fetch-and-store for PowerPC... and more!

2005-03-17 Thread Kevin Ryde
[EMAIL PROTECTED] (Ludovic Courtès) writes: I don't think so since `mem', as an address, isn't changed. Yep, I meant the contents. `memory' denotes the reservation bit I guess). No, memory normally means any crazy fetch or store, so gcc won't defer storing stuff and wont hold stuff in