[Chicken-users] About define-syntax and expansion environment

2013-06-14 Thread Xin Wang
Hi, I encountered a problem that previously defined macro can not be used inside other macro defination. It seems that newly defined syntax does not available in macro expansion environment, is it intended? Here are some simplified code: ---8--- (define-syntax fn (syntax-rules () ((fn

Re: [Chicken-users] About define-syntax and expansion environment

2013-06-14 Thread Peter Bex
On Fri, Jun 14, 2013 at 10:30:28PM +0800, Xin Wang wrote: Hi, I encountered a problem that previously defined macro can not be used inside other macro defination. It seems that newly defined syntax does not available in macro expansion environment, is it intended? That's correct; this

Re: [Chicken-users] About define-syntax and expansion environment

2013-06-14 Thread Xin Wang
2013/6/14 Peter Bex peter@xs4all.nl On Fri, Jun 14, 2013 at 10:30:28PM +0800, Xin Wang wrote: Hi, I encountered a problem that previously defined macro can not be used inside other macro defination. It seems that newly defined syntax does not available in macro expansion

[Chicken-users] socket egg: socket-receive blocks?

2013-06-14 Thread Kristian Lein-Mathisen
Hi Chickeners! I have come across a problem with multiple srfi-18 threads when tryping to listen to UDP sockets: (use socket) (set! *socket* (socket af/inet sock/dgram )) (set! (so-reuse-address? *socket*) #t) (socket-bind *socket* (inet-address 0.0.0.0 5055)) ;; (socket-receive ..) here blocks

Re: [Chicken-users] socket egg: socket-receive blocks?

2013-06-14 Thread Jim Ursetto
Hi, It's a bug in the socket egg; nonblocking mode is only set during a socket-connect or socket-accept, which won't be called for UDP. Temporary workaround: (use posix) and then, after creating the socket, do either: (##sys#file-nonblocking! (socket-fileno *socket*)) or equivalently

Re: [Chicken-users] socket egg: socket-receive blocks?

2013-06-14 Thread John Cowan
Jim Ursetto scripsit: Permanent fix: We should probably make all sockets nonblocking at creation time instead, since our machinery assumes nonblocking sockets. +1 -- John Cowan co...@ccil.org http://ccil.org/~cowan The exception proves the rule. Dimbulbs think: Your counterexample proves

Re: [Chicken-users] socket egg: socket-receive blocks?

2013-06-14 Thread Michele La Monaca
On Fri, Jun 14, 2013 at 10:24 PM, Jim Ursetto zbignie...@gmail.com wrote: Hi, It's a bug in the socket egg; nonblocking mode is only set during a socket-connect or socket-accept, which won't be called for UDP. I've already reported this issue in the list:

Re: [Chicken-users] socket egg: socket-receive blocks?

2013-06-14 Thread Jim Ursetto
Should be fixed in 0.2.3. Let me know. Jim On Jun 14, 2013, at 3:24 PM, Jim Ursetto zbignie...@gmail.com wrote: Hi, It's a bug in the socket egg; nonblocking mode is only set during a socket-connect or socket-accept, which won't be called for UDP. Temporary workaround: (use

Re: [Chicken-users] socket egg: socket-receive blocks?

2013-06-14 Thread Jim Ursetto
On Jun 14, 2013, at 4:29 PM, Michele La Monaca mikele.chic...@lamonaca.net wrote: I've already reported this issue in the list: http://lists.nongnu.org/archive/html/chicken-users/2013-05/msg00025.html Sorry, it got lost in the shuffle. Could you create a ticket for the other two issues you

Re: [Chicken-users] Issues with socket egg

2013-06-14 Thread Jim Ursetto
On May 8, 2013, at 8:48 AM, Michele La Monaca mikele.chic...@lamonaca.net wrote: 2) The egg doesn’t install on Cygwin due to the unbound identifier 'SO_EXCLUSIVEADDRUSE' (mingw only?). Dropping the related option (so/exclusiveaddruse) solves the problem. When you get a chance, can you

Re: [Chicken-users] Issues with socket egg

2013-06-14 Thread John Cowan
Jim Ursetto scripsit: On May 8, 2013, at 8:48 AM, Michele La Monaca mikele.chic...@lamonaca.net wrote: 2) The egg doesn’t install on Cygwin due to the unbound identifier 'SO_EXCLUSIVEADDRUSE' (mingw only?). Dropping the related option (so/exclusiveaddruse) solves the problem. When

Re: [Chicken-users] Issues with socket egg

2013-06-14 Thread Jim Ursetto
On Jun 14, 2013, at 6:07 PM, John Cowan co...@mercury.ccil.org wrote: You have to be a local Windows admin to set SO_EXCLUSIVEADDRUSE on at least some versions of Windows. I know. It falls back to SO_REUSEADDR in that case, which is broken on Windows but better than nothing. Jim

[Chicken-users] define rec

2013-06-14 Thread Daniel Ajoy
Hi, I'm new to Scheme when I type (define rec (lambda (n) (if (= n 0 ) oops! (/ 1 n ) ) ) ) The procedure seems to be accepted But when I do: (rec 1) I get: Error: (cadr) bad argument type: () Call history: syntax (rec 1) syntax (##core#letrec

Re: [Chicken-users] define rec

2013-06-14 Thread John Cowan
Daniel Ajoy scripsit: (rec 1) The trouble is that rec is a syntax keyword, and it's not being properly redefined. I call that a bug. See http://wiki.call-cc.org/man/4/Non-standard%20macros%20and%20special%20forms#rec -- Schlingt dreifach einen Kreis vom dies!John Cowan co...@ccil.org