Re: Problem using poule, zero? error in scsh-process

Pietro Cerutti via Chicken-users <[email protected]>
Newsgroups gmane.lisp.scheme.chicken
Message-ID <010701968d7e41c0-b121df77-24f1-4e96-9558-4342992d686f-000000@eu-central-1.amazonses.com>
On Apr 30 2025, 16:01 +0000, Matt Welland via Chicken-users <[email protected]> wrote:
[-- Type: text/plain; charset=UTF-8, Encoding: 7bit, Size: 1.2K --]
>Inserting the example code from poule into my existing project gives me the
>error below. I'm compiling statically but that doesn't seem to be a problem
>as I compiled the poule example statically and it worked fine. Everything
>else in my program works fine. I'll work around this for now but I can try
>any suggestions provided or dig deeper with any provided advice. Thanks.
>
>Error: (zero?) bad argument type - not a number: #f

poule uses (zero?) with the first value returned by (process-wait):
https://code.ptrcrt.ch/poule/file?ci=v0.1.1&name=poule.scm&ln=253-254

scsh-process substitutes (process-wait) with its own implementation:
https://api.call-cc.org/5/doc/scsh-process#sec:Process_reaping
https://code.more-magic.net/scsh-process/tree/scsh-process.scm?h=chicken-5#n125

It's possible for this implementation to return #f for the pid:
https://code.more-magic.net/scsh-process/tree/scsh-process.scm?h=chicken-5#n168


>
>Call history:
>
>/home/matt/data/hyphaworld/hmgr/build/dsjobs.scm:283: g2000
>/home/matt/data/hyphaworld/hmgr/build/dsjobs.scm:283: g2000
>/home/matt/data/hyphaworld/hmgr/build/dsjobs.scm:284: g2011
>/home/matt/data/hyphaworld/hmgr/build/dsjobs.scm:284: g2028
>scsh-process.scm:127: ##sys#call-with-values
>scsh-process.scm:127: wait
>scsh-process.scm:110: llrb-fixnum-table#table-ref/default
>scsh-process.scm:151: scheme#call-with-current-continuation
>scsh-process.scm:151: chicken.condition#with-exception-handler
>scsh-process.scm:151: ##sys#call-with-values
>scsh-process.scm:158: ##sys#call-with-values
>scsh-process.scm:159: posix-process-wait
>scsh-process.scm:168: scheme#values
>scsh-process.scm:151: k147
>scsh-process.scm:151: g150
>scsh-process.scm:127: scheme#values   <--

[-- Alternative Type #1: text/html; charset=UTF-8, Encoding: quoted-printable, Size: 1.5K --]

-- 
Pietro Cerutti
I have pledged to give 10% of income to effective charities
and invite you to join me - https://givingwhatwecan.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.