[Chicken-users] Wierd behaviour of process.

2007-01-12 Thread Robin Lee Powell

In the middle of the Scheme binding I wrote for mooix, I call
process (from posix) for IPC.  The system is, in total, very
complex; so much so that I don't even know where to start to at
making a pared-down example.

So, I'll describe the behaviour.

I run process in the same way (see
http://paste.lisp.org/display/35085 for my code; at least, that's
what it looked like after I had hacked it for a while trying to
solve this problem) quite a number of times.  At one point, process
calls a Perl script that is set sticky (not that I think that
matters, but there you are) that returns no output at all.  process
correctly sees it as returning no output.  The *next* call to
process appends a string, call it StringX, to the real output of the
process it calls, for no apparent reason.

StringX happens to be the mooix-internal name of the object whose
mooix method was the Perl script I mentioned.  I have no idea where
it's coming from in this interaction; it's not passed through
process at any point that I can see.

The really wierd part:

This only happens if the second argument to process is filled.  I
was filling it with (list "") just to avoid calling the shell
(security warm-fuzzies).  But now I've had to take that out, so this
will work.

This may very well *not* be a Chicken issue: as I said, the system
is very complex and, in particular, hacks a number of libc calls,
including exec*.

However, I've never seen this behaviour before, using either C or
Perl code in mooix, so... *shrug*

Any help/suggestions/things to try welcome, although I do have a
workaround.

-Robin

-- 
http://www.digitalkingdom.org/~rlpowell/ *** http://www.lojban.org/
Reason #237 To Learn Lojban: "Homonyms: Their Grate!"
Proud Supporter of the Singularity Institute - http://singinst.org/


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


Re: [Chicken-users] Mac OS X: chicken-setup's access to fink-installed libraries

2007-01-12 Thread Zbigniew

Stephen,

I haven't tried this in a few months, but last time I checked, chicken
will use any options you provided at ./configure time.  So for example
you could probably say

./configure CFLAGS="-O2 -L/sw/lib -I/sw/include"

and the options should be used automatically in the future.  Some
people have other ways of passing arguments to configure (there was a
discussion about it on the list) but for me that way always works.
This assumes you -always- want /sw to be looked at, which may be a
problem if you also install stuff in /usr/local/lib occasionally.

Otherwise I have been using the "-c" option to chicken-setup as you have found.

On 1/11/07, Stephen C. Gilardi <[EMAIL PROTECTED]> wrote:


I found an option to chicken-setup itself: "-csc-option" (abbreviated
"-c").  It works:

# chicken-setup -c "-I/sw/include -L/sw/lib" numbers
   gunzip -c ../numbers.egg | tar xf -
   /usr/local/bin/csc -feature compiling-extension -I/sw/include -L/
sw/lib -s -O2 -d1 numbers-base.scm -lgmp -X easyffi
Warning: invalid compiler option `-I/sw/include' - ignored
Warning: invalid compiler option `-L/sw/lib' - ignored
   rm -fr /usr/local/lib/chicken/1/numbers-base.so
   cp -r numbers-base.so /usr/local/lib/chicken/1/numbers-base.so
   cp -r numbers.scm /usr/local/lib/chicken/1/numbers.scm
   cp -r numbers.html /usr/local/lib/chicken/1/numbers.html

* The following documentation files have been installed in /usr/local/
lib/chicken/1/index.html:
   * numbers.html

   rm -fr numbers.egg-dir

It would be nice if options like that that I'll nearly always want to
specify could be provided via an environment variable rather than
always typed.




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


[Chicken-users] [Ann] Next meeting of the MSLUG

2007-01-12 Thread Dominique Boucher
The next meeting of the Montreal Scheme/Lisp User Group will be on 
January 17, 2007.


Talk: Adventures in Open Source Erlang, by Yariv Sadan.

When my blog posts about Erlang started receiving attention on 
reddit.com, I realized that my claims that Erlang could be a great web 
development language weren't compelling enough in the absence of a web 
develpment framework. This, together with my personal needs, lead me to 
create ErlyWeb, an open source web development framework for Erlang. In 
this presentation, I will talk about my discovery of Erlang, the 
development of ErlyWeb, and why I think Erlang's popularity will grow in 
the future.


http://schemeway.dyndns.org/mslug

Don't miss this talk!

Dominique Boucher



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


Re: Re : [Chicken-users] thread-sleep! for less than a second

2007-01-12 Thread Daishi Kato

Hi,

That was something that I could not notice either at first.
Another issue for me is that I want to declare fixnum
when all other procedures are fixnum arithmetic.
So, I wished thread-sleep-millis!
Any workaround for this? Maybe making a tiny egg for this?

Daishi

On 1/13/07, minh thu <[EMAIL PROTECTED]> wrote:

2007/1/12, Kon Lovett <[EMAIL PROTECTED]>:
> On Jan 12, 2007, at 1:36 PM, minh thu wrote:
>
> > Hi,
> >
> > Question again, my apologies ;)
> >
> > Is it possible to have a thread sleep some milliseconds ?
>
> thread-sleep! (the seconds do not need to be a whole number)
Tks, I didn't see it in the chicken doc or srfi-18.
thu


___
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] thread-sleep! for less than a second

2007-01-12 Thread minh thu

2007/1/12, Kon Lovett <[EMAIL PROTECTED]>:

On Jan 12, 2007, at 1:36 PM, minh thu wrote:

> Hi,
>
> Question again, my apologies ;)
>
> Is it possible to have a thread sleep some milliseconds ?

thread-sleep! (the seconds do not need to be a whole number)

Tks, I didn't see it in the chicken doc or srfi-18.
thu


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


Re: [Chicken-users] thread-sleep! for less than a second

2007-01-12 Thread Kon Lovett

On Jan 12, 2007, at 1:36 PM, minh thu wrote:


Hi,

Question again, my apologies ;)

Is it possible to have a thread sleep some milliseconds ?


thread-sleep! (the seconds do not need to be a whole number)



I want to have a thread poll xlib for some events but not in tight
loop neither only every second (thus something in between). I guess
also than thread-yield! gives cpu to other threads but still makes a
tight loop in case the other threads want to sleep!

I can't use c sleeping function, otherwise the whole chicken runtime
will go to bed.

Is there any workaround ? Maybe I can add the feature to chicken  
itself ?


Thanks,
thu


___
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] thread-sleep! for less than a second

2007-01-12 Thread minh thu

Hi,

Question again, my apologies ;)

Is it possible to have a thread sleep some milliseconds ?

I want to have a thread poll xlib for some events but not in tight
loop neither only every second (thus something in between). I guess
also than thread-yield! gives cpu to other threads but still makes a
tight loop in case the other threads want to sleep!

I can't use c sleeping function, otherwise the whole chicken runtime
will go to bed.

Is there any workaround ? Maybe I can add the feature to chicken itself ?

Thanks,
thu


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


Re : Re : [Chicken-users] various questions

2007-01-12 Thread minh thu

2007/1/12, Kon Lovett <[EMAIL PROTECTED]>:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Jan 12, 2007, at 12:31 AM, felix winkelmann wrote:

> On 1/11/07, minh thu <[EMAIL PROTECTED]> wrote:
>> >
>> > Could you elaborate on this? Do you want to let the user specify
>> the
>> > actual record type, or it's contents?
>> The record type.
>> Say mailbox use a list-based queue implementation (so 'mailbox' in
>> the
>> following sentences is a hypothetical one).
>> Could I provide another implementation of a queue to be used by
>> mailbox?
>> Or could the author of mailbox make it possible by providing
>> different
>> implementations ?
>> I don't know module systems but maybe my question is wheter we can
>> parametrize a module when loading (instanciating ?) it.
>>
>
> Well, this is what is called "functors" in SML, for example:
> parameterized
> modules. You provide a module implementing the operations on
> a specific datatype and pass this module to your mailbox module.
> A (very basic) implementation of such functors is in the "lexmod" egg:
>
> http://chicken.wiki.br/lexmod

The 'levenshtein' egg has a generic algorithm, it works w/ strings or
vectors. It uses the facilities of 'procedure-surface' to provide the
appropriate procedures.



Thanks for pointing this. I'll try for the moment to stick to somewhat
standard Sheme because I'm fairly noob and don't want to learn another
library (in addition of Scheme and chicken specifics). Probably later
though.

thu


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


Re: Re : [Chicken-users] various questions

2007-01-12 Thread John Cowan
Kon Lovett scripsit:

> It uses the facilities of 'procedure-surface' to provide the  
> appropriate procedures.

Can you explain 'procedure-surface' in a little more detail, please?
It looks like just the thing for me, but it has too many procedures and
too few explanations.

Thanks.

-- 
On the Semantic Web, it's too hard to prove John Cowan[EMAIL PROTECTED]
you're not a dog.  --Bill de hOra   http://www.ccil.org/~cowan


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


Re: Re : [Chicken-users] various questions

2007-01-12 Thread Kon Lovett

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Jan 12, 2007, at 12:31 AM, felix winkelmann wrote:


On 1/11/07, minh thu <[EMAIL PROTECTED]> wrote:

>
> Could you elaborate on this? Do you want to let the user specify  
the

> actual record type, or it's contents?
The record type.
Say mailbox use a list-based queue implementation (so 'mailbox' in  
the

following sentences is a hypothetical one).
Could I provide another implementation of a queue to be used by  
mailbox?
Or could the author of mailbox make it possible by providing  
different

implementations ?
I don't know module systems but maybe my question is wheter we can
parametrize a module when loading (instanciating ?) it.



Well, this is what is called "functors" in SML, for example:  
parameterized

modules. You provide a module implementing the operations on
a specific datatype and pass this module to your mailbox module.
A (very basic) implementation of such functors is in the "lexmod" egg:

http://chicken.wiki.br/lexmod


The 'levenshtein' egg has a generic algorithm, it works w/ strings or  
vectors. It uses the facilities of 'procedure-surface' to provide the  
appropriate procedures.





cheers,
felix


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


-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (Darwin)

iEYEARECAAYFAkWnumwACgkQJJNoeGe+5O6M5QCcCe8eIhP+tcKlzdpRrw5XM0rn
4JsAn1fEfwkMTLvDx9nqUV2fzYPmzr/Y
=D0Km
-END PGP SIGNATURE-


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


Re : [Chicken-users] writing from a thread issue

2007-01-12 Thread minh thu

2007/1/12, felix winkelmann <[EMAIL PROTECTED]>:

On 1/12/07, minh thu <[EMAIL PROTECTED]> wrote:
>
> (define (poll-for-event)
>   (define (poll) ((write "in poll-for-event") ; not shown

That line above has a "(" to much. The arguments become
evaluated, but before the write is executed, the call to "poll"
is. The write is in operator position and might be executed
after the "(poll)".

Just remove the parens around the forms in "poll".


cheers,
felix


Oh thanks, I've looked at something like this but didn't find (so stupid).
And sorry too,

thu


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


Re: [Chicken-users] writing from a thread issue

2007-01-12 Thread felix winkelmann

On 1/12/07, minh thu <[EMAIL PROTECTED]> wrote:


(define (poll-for-event)
  (define (poll) ((write "in poll-for-event") ; not shown


That line above has a "(" to much. The arguments become
evaluated, but before the write is executed, the call to "poll"
is. The write is in operator position and might be executed
after the "(poll)".

Just remove the parens around the forms in "poll".


cheers,
felix



  (newline)  ; shown
  (flush-output) ; changes nothing
  (thread-sleep! 1)
  (poll)))
  (poll))




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


[Chicken-users] writing from a thread issue

2007-01-12 Thread minh thu

Hi,

I made a script of my session to exhibit the problem:
No output is given by the thread but the blank lines.

Thanks for any help,
thu

Follows the output of my session (in a console in linux).

$ cat weird.scm
;;; weird.scm
;;
;; 12.01.2007
;;
;; Exhibits non-writing from a thread.
;;

(declare (uses srfi-18))

(define (poll-for-event)
 (define (poll) ((write "in poll-for-event") ; not shown
  (newline)  ; shown
  (flush-output) ; changes nothing
  (thread-sleep! 1)
  (poll)))
 (poll))

(define (go)
 (thread-start! poll-for-event))
$ csc -s weird.scm
$ csi -require-extension weird
)   ___
(__/_) /)   ,/)
 /   (/  _ (/_   _ __
// )__(_(__/(___(/_/ (_
(__)
Version 2, Build 3 - linux-unix-gnu-x86 - [ dload ptables ]
(c)2000-2005 Felix L. Winkelmann
; loading ./weird.so ...
#;1> (go)
#
#;2>






$ # I've done a ctrl-c. Notice the blank lines after #;2>


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


Re: [Chicken-users] RedHat and Debian packages

2007-01-12 Thread Peter Busser
On Thu, Jan 11, 2007 at 12:56:56PM +0200, Harri Haataja wrote:

> In some cases you
> can make repositories outside the vendor's and add them to something
> like apt. If they're in sync to the right versions it might even work.

The Adamantix project tries to do its best to create quality packages.
Packages provided for Debian and other distributions by Adamantix are
supported. So if something is not working, you can report it to the
mailing list ([EMAIL PROTECTED], subscribers only though).
Commercial support for these packages is also available.

All fixes in Adamantix packages immediately go upstream (i.e. to Felix in
most cases). The Adamantix project also contributes eggs to the Chicken
project (like the magic egg, but more are to follow).

> Getting a friendly maintainer on the "inside" (a Debian developer, for
> example) is probably a more reliable approach.

If Debian or any other distribution likes to use the Adamantix packages,
then that is fine of course. It is after all free software.

Integrating these packages in Debian means that only Debian users
benefit from this effort. My idea is to support as many distributions as
possible, not only Debian. That way this effort benefits users of Adamantix,
Ubuntu, Progeny, Knoppix, etc., etc. as well, not just users of Debian. And
it has the following advantages for Chicken users:

This effort makes it easier and more reliable to:

  - Install Chicken (there are a few distributions with Chicken packages)
  - Install Chicken eggs (only available in Adamantix AFAIK)
  - Install Chicken applications (available nowhere, except for a few in
Adamantix). Applications require proper egg dependencies to work.
  - To distribute Chicken applications (the same infrastructure can be
used).
  - To support multiple platforms (because the same Chicken and egg versions
with the same features are available on all supported platforms).
  - Provide the same high quality to all platforms.

And all feedback results in improvements for ALL supported distributions
at the same time (as well as upstream).

Groetjes,
Peter.


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


Re: Re : [Chicken-users] various questions

2007-01-12 Thread minh thu

2007/1/12, felix winkelmann <[EMAIL PROTECTED]>:

On 1/11/07, minh thu <[EMAIL PROTECTED]> wrote:
> >
> > Could you elaborate on this? Do you want to let the user specify the
> > actual record type, or it's contents?
> The record type.
> Say mailbox use a list-based queue implementation (so 'mailbox' in the
> following sentences is a hypothetical one).
> Could I provide another implementation of a queue to be used by mailbox?
> Or could the author of mailbox make it possible by providing different
> implementations ?
> I don't know module systems but maybe my question is wheter we can
> parametrize a module when loading (instanciating ?) it.
>

Well, this is what is called "functors" in SML, for example: parameterized
modules. You provide a module implementing the operations on
a specific datatype and pass this module to your mailbox module.
A (very basic) implementation of such functors is in the "lexmod" egg:

http://chicken.wiki.br/lexmod


cheers,
felix



Thank you. For the thread/print issue, I will retry and maybe post the
offending code (after cleaning it of irrevlevent things).
thu


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


Re: [Chicken-users] Mac OS X: chicken-setup's access to fink-installed libraries

2007-01-12 Thread felix winkelmann

On 1/11/07, Stephen C. Gilardi <[EMAIL PROTECTED]> wrote:


It would be nice if options like that that I'll nearly always want to
specify could be provided via an environment variable rather than
always typed.

Feature request:

- "chicken" automatically includes options specified in the
environment variable "CHICKEN_OPTIONS".  Can we extend that mechanism
to "csc" "csi" and "chicken-setup"?  Environment variable names that
follow the pattern would be "CSC_OPTIONS" "CSI_OPTIONS" and
"CHICKEN_SETUP_OPTIONS".

In this case, I would specify "CSC_OPTIONS".


CSI_OPTIONS is already available, and CHICKEN_SETUP_OPTIONS
has been added recently (available in the darcs repository and the
current development snapshot). I'll add CSC_OPTIONS, though.
Thanks for the suggestion.


cheers,
felix


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


Re: Re : [Chicken-users] various questions

2007-01-12 Thread felix winkelmann

On 1/11/07, minh thu <[EMAIL PROTECTED]> wrote:

>
> Could you elaborate on this? Do you want to let the user specify the
> actual record type, or it's contents?
The record type.
Say mailbox use a list-based queue implementation (so 'mailbox' in the
following sentences is a hypothetical one).
Could I provide another implementation of a queue to be used by mailbox?
Or could the author of mailbox make it possible by providing different
implementations ?
I don't know module systems but maybe my question is wheter we can
parametrize a module when loading (instanciating ?) it.



Well, this is what is called "functors" in SML, for example: parameterized
modules. You provide a module implementing the operations on
a specific datatype and pass this module to your mailbox module.
A (very basic) implementation of such functors is in the "lexmod" egg:

http://chicken.wiki.br/lexmod


cheers,
felix


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


Re: [Chicken-users] csi scripts

2007-01-12 Thread felix winkelmann

On 11 Jan 2007 14:41:22 -0200, Mario Domenech Goulart
<[EMAIL PROTECTED]> wrote:

Hello,

At http://chicken.wiki.br/writing%20portable%20scripts we have a
section called "Writing portable scripts with env" whose instructions
doesn't seem to be very portable.

At least it doesn't work on my system:

  $ ./s.scm
  /usr/bin/env: csi -s: No such file or directory

  $ cat s.scm
  #! /usr/bin/env csi -s

  (print (argv))

There's a discussion on the guile mailing list about this topic:
http://sourceware.org/ml/guile/1997-11/msg00034.html

If nobody has objections, I'll remove the "Writing portable scripts
with env" section from the wiki.



Fine with me.


cheers,
felix


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