IRC channel logs

2023-03-07.log

back to list of logs

<old>unmatched-paren: Procedure capture their environment when declared. Calling a procedure with another environment seems like it would break the fundamental idea of lexical scoping
<old>My assumption hhere is that you want: (define (get-x) x)
<old>Then: (call-with-environment (some-environment-with-x=10) get-x) => 10
<old>Then: (call-with-environment (some-environment-with-x=100) get-x) => 100
<old>To do that I guess you could like others suggested, evaluate the quoted expression in the environment, thus creating a new procedure that will capture x in the good environment
<old>otherwise. you would have to mutate the captured environment or change its reference in the procedure
<old>maybe that's not what you were asking, in that case just ignore me :-)
<cow_2001>okay, spawned process espeak-ng turns into a zombie process for some reason after it is piped some text
<cow_2001>just saw that in htop
<cow_2001>why would that happen?
<jpoiret>old: maybe you could consider using a reader monad?
<jpoiret>i know it's not very schemey but it does seem like the right abstraction for the task
<jpoiret>oops, that's the wrong person, it should be unmatched-paren instead
<old>cow_2001: When a process die, it goes in zombie state. The parent has to wall `waitpid' on the PID of the child to rip it
<old>if the parent dies before that, the fallen child is re-parent to the init process (PID 1) that usually loop with `wait' on any available PID to rip
<old>what primitive in Guile did you used for spawning espeak-ng?
<cow_2001>(spawn)
<cow_2001>old: i'm stumped.
<cow_2001>before that i used open-pipe*
<old>`spawn' returns a PID
<old>After writing to the pipe, i.e. communicating your intent to the child, you have to wait for it to terminate
<old>by calling `waitpid'
<cow_2001>look at this embarrassing mess https://0x0.st/Hir3.scm
<old>an example is shown in the manual as of 3.0.9
<cow_2001>i don't want to terminate it, just want it to wait for another put-string into its pipe
<cow_2001>i want the parent to loop over a fifo file, and whenever it get-line, to pass the that line to the espeak-ng input pipe
<cow_2001>it mysteriously works on python but not here. no clue why
<cow_2001> https://codeberg.org/yuvallangerontheroad/clipboard-speaker/src/commit/f54596abf9836b72bf53329b98c17e1a1cb4d51b/clipboard_speaker/clipboard_speaker.py
<cow_2001>oh wait a minute
<old>for starter why are you forcing output on an input fifo?
<old> (force-output fifo-port)
<old>O_NONBLOCk is maybe not what you wnat
<old>the child process will try to read and the system call will return EWOULDBLOCK
<old>perhaps it then simply exit, thus the zombie state
<jlicht>Is the date metadata entry supposed to be mandatory for posts in haunt?
<dthompson>jlicht: I wouldn't say it's strictly mandatory but there's plenty of default behavior that does things like sort chronologically
<jlicht>dthompson: thanks! I ran into some crashes when running haunt build for posts that had no date. Either way, I sent you a small patch that I'm locally using for now
<dthompson>jlicht: oh cool, thanks! I'll take a look later1
<jlicht>don't feel pressured to accept it; I'll have to add dates to my files at some point in the future either way ;)