01:57
aw- has quit [Quit: Leaving.]
01:59
aw- has joined #picolisp
02:49
chexum has quit [Ping timeout: 258 seconds]
03:14
chexum has joined #picolisp
04:21
seninha has quit [Quit: Leaving]
05:36
<
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 :)
06:19
<
abu[m] >
Hi Hunar, yes, 'in' is a single pipe (i.e.input)
06:20
<
abu[m] >
'pipe' can be used
06:22
<
Hunar >
Ah, that's the mistake
06:23
<
abu[m] >
(pipe (out '(python ...) (prinl ...)) (line ...
06:27
<
Hunar >
:D thanks, I try to make generic (python ...) function to use python from pil .. let's see how far I can get
06:29
<
abu[m] >
Good. You may also experiment with (setq *Python (pipe (exec "python" "foo")))
06:30
<
abu[m] >
Then (out *Python (prinl ...)) and (in *Python ..., but be careful not te lock it up
06:30
<
abu[m] >
(in *Python ...) may be better in an asynchronous 'task' then
06:31
<
abu[m] >
As you know, PilBox uses this in communicating with the Android JRE
06:32
<
Hunar >
:D I'll try it
06:47
lagash has quit [Ping timeout: 264 seconds]
06:59
<
Hunar >
how to close the pipe *Python
07:00
<
abu[m] >
(close *Python)
07:02
<
Hunar >
Ah 😅 I was searching in (doc 'pipe)
07:22
<
abu[m] >
It is important that the exec'ed program always flushes stdout after each reply
07:22
<
abu[m] >
Most programs do that automatically after a newline
07:29
<
abu[m] >
But usually only if the current TTY is a terminal
07:34
lagash has joined #picolisp
07:36
<
abu[m] >
For example, this creates a pipe to a Pil process: (setq P (pipe (exec "pil" "-while (read) (println (eval @)) (flush)" "-bye")))
07:36
<
abu[m] >
Note the (flush)
07:50
<
tankf33der >
Can not write function mike to process list recursively
07:50
<
tankf33der >
so frustrating
07:50
<
tankf33der >
even do not what to google
08:50
<
Hunar >
Thanks for the info :) I'm sure I'll encounter it
08:51
<
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
08:51
<
Hunar >
I can do most of the work in python, I think text parsing is easier there
08:52
<
Hunar >
currently I want to (glue) some text while keeping quotes. (glue ", " "hello" 1) I want something like \"hello\", 1
08:54
<
abu[m] >
Perhaps use 'sym'?
08:56
<
Hunar >
looks good :)
09:16
<
abu[m] >
Hi tankf33der!
09:16
<
abu[m] >
Process the list in which way?
09:17
<
abu[m] >
Recurse on sublists?
09:17
<
Hunar >
It got complicated in pil, So I'll do everything in python.
09:17
<
Hunar >
I have a small issue, when using the pipe
09:17
<
Hunar >
(prinl '(1 "hello")) sends 1hello to python
09:17
<
Hunar >
but using (println '(1 "hello")) still sends the same thing, instead of sending (1 "hello")
09:18
<
abu[m] >
No, 'println' sends differently
09:20
<
Hunar >
I want to send the (read) able from to python and parse it there
09:20
<
abu[m] >
Better first write all to a file and then look at it
09:24
<
abu[m] >
So (println (1 "hello")) will definitely send the string "(1 \"hello\")"
09:24
<
abu[m] >
Perhaps the receiving end is wrong?
09:28
<
Hunar >
I don't know what is going on, the python file is just print(inout())
09:28
<
Hunar >
sorry input()
09:29
<
abu[m] >
No idea, I don't know Python
10:20
<
Hunar >
Aaah, I was (read)ing the result that python was sending back, one hour wasted 😅
10:26
Hunar has quit [Read error: Connection reset by peer]
10:26
abu[m] has quit [Remote host closed the connection]
10:29
abu[m] has joined #picolisp
10:44
Hunar has joined #picolisp
11:59
seninha has joined #picolisp
12:45
chexum has quit [Quit: No Ping reply in 180 seconds.]
12:47
chexum has joined #picolisp
21:23
chexum has quit [Quit: No Ping reply in 180 seconds.]
21:25
chexum has joined #picolisp
21:26
chexum has quit [Remote host closed the connection]
21:26
chexum has joined #picolisp
22:08
seninha has quit [Ping timeout: 250 seconds]