beneroth changed the topic of #picolisp to: PicoLisp language | The scalpel of software development | Channel Log: https://libera.irclog.whitequark.org/picolisp | Check www.picolisp.com for more information
aw- has quit [Quit: Leaving.]
aw- has joined #picolisp
chexum has quit [Ping timeout: 258 seconds]
chexum has joined #picolisp
seninha has quit [Quit: Leaving]
<Hunar> Hello :) I tried experimenting with pipes, wrote this print("Hello", input()) to a.py and in pil I entered (in '(python "a.py") (prinl "hunar") (line T)) but this didn't work, prinl uses stdout instead of the pipe, isn't the pipe bi-directional? or I understood the whole thing wrong :)
<abu[m]> Hi Hunar, yes, 'in' is a single pipe (i.e.input)
<abu[m]> 'pipe' can be used
<Hunar> Ah, that's the mistake
<abu[m]> (pipe (out '(python ...) (prinl ...)) (line ...
<Hunar> :D thanks, I try to make generic (python ...) function to use python from pil .. let's see how far I can get
<abu[m]> Good. You may also experiment with (setq *Python (pipe (exec "python" "foo")))
<abu[m]> Then (out *Python (prinl ...)) and (in *Python ..., but be careful not te lock it up
<abu[m]> (in *Python ...) may be better in an asynchronous 'task' then
<abu[m]> As you know, PilBox uses this in communicating with the Android JRE
<Hunar> :D I'll try it
lagash has quit [Ping timeout: 264 seconds]
<Hunar> how to close the pipe *Python
<abu[m]> (close *Python)
<abu[m]> 😉
<Hunar> Ah 😅 I was searching in (doc 'pipe)
<abu[m]> It is important that the exec'ed program always flushes stdout after each reply
<abu[m]> Most programs do that automatically after a newline
<abu[m]> But usually only if the current TTY is a terminal
lagash has joined #picolisp
<abu[m]> For example, this creates a pipe to a Pil process: (setq P (pipe (exec "pil" "-while (read) (println (eval @)) (flush)" "-bye")))
<abu[m]> Note the (flush)
<tankf33der> Can not write function mike to process list recursively
<tankf33der> so frustrating
<tankf33der> even do not what to google
<Hunar> Thanks for the info :) I'm sure I'll encounter it
<Hunar> since python has eval() it made my job very easy, but I don't know if I should write the logic in pil or python
<Hunar> I can do most of the work in python, I think text parsing is easier there
<Hunar> currently I want to (glue) some text while keeping quotes. (glue ", " "hello" 1) I want something like \"hello\", 1
<abu[m]> Perhaps use 'sym'?
<Hunar> looks good :)
<abu[m]> Hi tankf33der!
<abu[m]> Process the list in which way?
<abu[m]> Recurse on sublists?
<Hunar> It got complicated in pil, So I'll do everything in python.
<Hunar> I have a small issue, when using the pipe
<Hunar> (prinl '(1 "hello")) sends 1hello to python
<Hunar> but using (println '(1 "hello")) still sends the same thing, instead of sending (1 "hello")
<abu[m]> No, 'println' sends differently
<Hunar> I want to send the (read) able from to python and parse it there
<abu[m]> Better first write all to a file and then look at it
<abu[m]> So (println (1 "hello")) will definitely send the string "(1 \"hello\")"
<abu[m]> Perhaps the receiving end is wrong?
<Hunar> I don't know what is going on, the python file is just print(inout())
<Hunar> sorry input()
<abu[m]> No idea, I don't know Python
<Hunar> Aaah, I was (read)ing the result that python was sending back, one hour wasted 😅
<abu[m]> oh ;)
Hunar has quit [Read error: Connection reset by peer]
abu[m] has quit [Remote host closed the connection]
abu[m] has joined #picolisp
Hunar has joined #picolisp
seninha has joined #picolisp
chexum has quit [Quit: No Ping reply in 180 seconds.]
chexum has joined #picolisp
chexum has quit [Quit: No Ping reply in 180 seconds.]
chexum has joined #picolisp
chexum has quit [Remote host closed the connection]
chexum has joined #picolisp
seninha has quit [Ping timeout: 250 seconds]