ChanServ changed the topic of #picolisp to: PicoLisp language | Channel Log: https://irclog.whitequark.org/picolisp/ | Picolisp latest found at http://www.software-lab.de/down.html | check also http://www.picolisp.com for more information
jibanes has quit [Ping timeout: 256 seconds]
jibanes has joined #picolisp
orivej has quit [Ping timeout: 276 seconds]
cilz has joined #picolisp
<cilz> Good morning
<Regenaxer> Hi cilz!
<cilz> Hello Regenaxer ;-)
<Regenaxer> :)
cilz has quit [Ping timeout: 246 seconds]
cilz has joined #picolisp
cilz has quit [Quit: Quit]
cilz has joined #picolisp
cilz has quit [Client Quit]
cilz has joined #picolisp
aw- has joined #picolisp
<aw-> hi all
<aw-> Regenaxer: did you fix the Samsung pilbox issue?
<Regenaxer> Hi aw-!
<Regenaxer> Not yet, I don't have access to such a device
<aw-> ok
<Regenaxer> I'll ask today that they send one to me
<aw-> try this: ln -s /lib /lib64
<aw-> oh you don't have the device..
<Regenaxer> yes, and we cannot root it
<Regenaxer> They bought several of them for production use
<aw-> i noticed sometimes some libs appear in /lib and some binaries search in /lib64 and give that "not found" error because the paths are missing
<aw-> the error is misleading
<aw-> would be nice if you can get a terminal and type commands
<aw-> like ldd
<Regenaxer> I think on Android there is even no /lib/
<aw-> haha you're right
<Regenaxer> Some people here suspected Samsun Knox
<aw-> ohhhh that
<aw-> that's possible
<Regenaxer> As soon as I get one device, I build a special version of PilBox for debugging
<Regenaxer> basically logging things to see what goes wrong
<aw-> right
<Regenaxer> In general the Xcover 4 looks nice. There was a test in c't magazine
<Regenaxer> robust and inexpensive
<Regenaxer> ideal for the intended purpose (logistics)
<aw-> nice if it can run Pilbox ;)
<beneroth> (and (hi all) (have a nice day) (bbl))
<Regenaxer> aw-, yeah, very useful device
<Regenaxer> (hi beneroth)
rob_w has joined #picolisp
<aw-> (out 'beneroth (prinl "hey"))
<beneroth> xD
aw- has quit [Quit: Leaving.]
<Nistur> mornin'
<cess11_> Good morning.
<cess11_> Looks like you're making good progress on the ImageMagick bindings.
<Nistur> yep :)
<Nistur> I meana, it's still just doing `convert Raw/* output.pdf`
<Nistur> but it gives me more flexibility now
<Nistur> aaaaand
<Nistur> I'm considering also wrapping up what I've got into (im:convert "Raw/*" "output.pdf") just for fun, not that I'd actually use that :P
<Nistur> I'm also trying to think of ways to make it more lispy, rather than being just a thin wrapper around the C lib
<Nistur> because currently there's a lot of things like doing (im:next-image wand) and the like, to go through the images loaded into the 'wand'
<cess11_> The lispy part will probably be where you automate gathering of input data and the presentation of output.
<Nistur> but surely there should be a way to expose the wand as a list so you can act on it more natively
<cess11_> Most likely.
<Nistur> I don't (yet) know how well picolisp will support this... because obviously it makes sense to keep the underlying C data, and not move the data into lisp, because then you'd have to have a tonne of conversion back and forth... but I think it's a bit of a weird thing to expect pil to be able to override it's idea of a list... especially saying "this C ptr is actually a list and to do listy things with it,
<cess11_> A few times I've put a little effort into figuring out how to use libcairo from pil but haven't got very far yet.
<Nistur> you call X(), Y() or Z()"
arievw2 has joined #picolisp
orivej has joined #picolisp
mtsd has joined #picolisp
<arievw2> Is there an archive of this chat somewhere?
<Nistur> arievw2: I don't think there are public logs, but a few of us may keep logs. I think mine is set up to something like 2 months
<mtsd> Morning all
<Nistur> hulloo
<mtsd> I think there is a log, have a look here: https://irclog.whitequark.org/picolisp/
<Nistur> aha, I stand corrected
freeemint has joined #picolisp
<freeemint> Hello
<Nistur> guten morgen :)
<freeemint> Guten Vormittag
<Nistur> :)
<Nistur> I've only just got to work, so it's still very much morning for me :P
<freeemint> I see
mtsd has quit [Read error: Connection reset by peer]
mtsd has joined #picolisp
<freeemint> Regenaxer, do you have any recommendation how a family could listen on multiple ports. (I am thinking about having a webserver and a telnet server access the same database)
<freeemint> (access as in read/write)
<freeemint> My first ideas was to spawn two child processes which would create all the webserver or telnet processes. But that will not work, since webserver processes would not be able to 'tell to there telnet cousins.
<Regenaxer> Hi freeemint! The pil GUI does exactly this, allocating a private port per child process
<cess11_> IPC isn't needed for sharing a database between processes.
<freeemint> Regenaxer, I want multiple connections on the same port so no private ports
<Regenaxer> Not sure I understand what you want to do
<freeemint> I want to have 1 child process per connection.
<freeemint> A connection can happen only over 2 fixed ports
<freeemint> the two different ports serve different protocols
<Regenaxer> I don't know how this should work, as each child does not know which incoming data are for her
<Regenaxer> I would make one dispatcher process
<freeemint> each child gets the socket of the connection he is respovible for
<Regenaxer> one connection is one socket
<freeemint> yes
<Regenaxer> all data pop up there
<freeemint> yes
<Regenaxer> So a dispatcher can examine the data and send them to other processes
<Regenaxer> Not sure I understand what you want to do
<Regenaxer> httpGate does this
<Regenaxer> it listens only on 80 or 443
<freeemint> I use an non http protocol though
<Regenaxer> and dispatches on the port in the URL
<Regenaxer> yes, so something analog
<Regenaxer> But you can't have several processes listen on a single port
<freeemint> yes
<freeemint> I want to do that with an disptacher
<Regenaxer> good
<Regenaxer> and then (tell <pid> ...)?
<freeemint> but i want an dispatcher listening on two ports which creates a different kind of child process depending on which port the connection(=socket) is comming from.
<Regenaxer> I have not tried, but you could listen on two ports with two 'task's
<Regenaxer> 'accept' function instead of 'listen'
<Regenaxer> (task Sock1 (and (accept @) ...))
<Regenaxer> (task Sock2 (and (accept @) ...))
<Regenaxer> cause 'listen' would block
<freeemint> I accept does not?
<Regenaxer> yes, not
<freeemint> ok.
<Regenaxer> see the 'server' function
<Regenaxer> at the end
<freeemint> Ok why not a loop with two accepts? rather than a task?
<Regenaxer> the loop would waste CPU time polling
<freeemint> what would tasks do?
<Regenaxer> (doc 'task)
<freeemint> (why not have an expecit wait?
<freeemint> or use 'listen with timeout
<freeemint> *explicit
<Regenaxer> A wait would wait :)
<Regenaxer> Try it
<Nistur> Regenaxer: I have another Samsung device I can test on now :P I just went out and bought an S7 :P It's even limited to 7.0 :P
<freeemint> (accept (port 8888)) blocks too.
<freeemint> .... no it doe not
<freeemint> accept wait 20 seconds for a connection
<freeemint> *waits
<Regenaxer> Nistur, great!
<freeemint> what is the difference between (listen p 20) and (accept p)
<Nistur> I'll try it in a bit, I need to expense it first so my bank doesn't call me and tell me I'm in trouble :P
<Regenaxer> freeemint, you need to understand tasks in pil. They are very important
<freeemint> Regenaxer ... i will ... some day
<Regenaxer> See my examples above
<Regenaxer> (task Sock1 (and (accept @) ...))
<Regenaxer> Call accept only when select() reports that data are available on the connection
<Regenaxer> man 2 select
<Regenaxer> 'task' is a front-end to select() system calls
<Regenaxer> or '*Run' to be more correct
<freeemint> That means while accept is running running tasks can be executed while tasks can not be executed if listen is running?
<Regenaxer> nope
<freeemint> How are (accept p) and (listen p 20) different?
<Regenaxer> Almost the same, just that 'listen' sets up its own event loop around
<Regenaxer> around select() and accept() I mean
<Regenaxer> But 'listen' is not useful for your purpose, as it listens on a single socket
<Regenaxer> So you need two tasks to wait for data on two or more sockets
<Regenaxer> ... two tasks to wait for data on two sockets
<Nistur> Regenaxer: works on the S7 fine too
<Regenaxer> Good news! So it works on all tested devices so far, except Xcover
<Regenaxer> Thanks!
<Regenaxer> They said they send one Xcover to me today
<Regenaxer> Should be here tomorrow then
<Regenaxer> I'm looking forward to try it out
<freeemint> Regenaxer, why is accepts timeout hard coded to be 20s ?
<Nistur> I would really like to know what it is that causes this issue, because I have no idea what it could be, we've used a similar Samsung OS version, we've tried a bunch of different devices... similar chipsets...
<Regenaxer> Unix select() may return that data are available, but then in fact they are not, due to rejected packets or so
<Regenaxer> So accept would block infinitely
<Regenaxer> Nistur, yeah
<Regenaxer> freeemint, these cases are extremely rare
<Regenaxer> so normally it never blocks if used in a task
<freeemint> ah
<freeemint> Regenaxer, that is ugly of UNIX
<Regenaxer> Yeah, or probably of the TCP protocol
<freeemint> do i need to check if accept returned nil?
<Regenaxer> yes
<Regenaxer> (task Sock1 (and (accept @) ...))
<Nistur> Regenaxer: I have found some security settings in the S7 (not sure if I've seen them in my S8) I can see if any of them could break it during my lunch break
<Regenaxer> Cool! If so I know what to try first ;)
<freeemint> afl
<Nistur> away... from... life?
<Nistur> llamas?
<Regenaxer> away from laptop?
<Regenaxer> haha
<Nistur> ahh
<Nistur> makes more sense
<Regenaxer> or Linux? Would be bad
<Regenaxer> away from life hopefully not
<Nistur> not nearly as bad as being away from llamas though
<Regenaxer> :)
<Nistur> Regenaxer: a quick search through the settings while waiting for a download doesn't leave me hopeful that there's much there which could affect it
<Regenaxer> ok, np
<freeemint> lenovo but close enough
<freeemint> (yes a laptop)
<freeemint> bff
<freeemint> (back from food)
mtsd has quit [Remote host closed the connection]
mtsd has joined #picolisp
mtsd has quit [Remote host closed the connection]
<Regenaxer> I see, run Linux on Mac
<Regenaxer> Not sure if this is a good idea ;)
<Nistur> no, but it MIGHT work :P
<Nistur> I think installing ubuntu within macOS is a bit overkill
<Nistur> but if you can install another distro, it might be actually usable
<Regenaxer> yep, some minimal system
<Regenaxer> eves self-made with live-build
<Nistur> the environment appears to be 100MB download, so it's not a full Ubuntu 16.04... it might be usable as a dev environment then
orivej has quit [Ping timeout: 264 seconds]
cilz has quit [Ping timeout: 256 seconds]
cilz has joined #picolisp
freeemint has quit [Quit: Leaving]
<Nistur> Regenaxer: how difficult would it be to make something like ix.io in picolisp do you think?
<tankf33der> highlighting is hardest part
<tankf33der> Nistur: start with URL shortener :)
<Nistur> ix.io does neither of those things
<Nistur> you just curl up a file, or some data, and then get given back a URL, which I assume is just a key to a db entry, using that URL you just get a plaintext response with that data
orivej has joined #picolisp
<Regenaxer> Sorry, phone all the time
<Regenaxer> What exactly is ix.io for?
<Nistur> Regenaxer: it's just like a pastebin which I can curl my files to
<Regenaxer> We must trust them, right
<Nistur> http://ix.io
<Regenaxer> yeah
<Nistur> instructions are all there :)
<Regenaxer> looked at it
<Regenaxer> Not so difficult to make. Data stuffed into DB blobs
<Nistur> yeah, that's what I was thinking :)
* Nistur was considering making a paste.nistur.com :P
<Nistur> just so I could be hosting my own pastes :P
<tankf33der> Nistur: http://www.freestylegames.com/
<tankf33der> why it doesnt work ?
<Nistur> tankf33der: aha, it doesn't exist any more :)
<Nistur> got bought by ubisoft
<Nistur> it is now Ubisoft Leamington :P
<tankf33der> even link in wikipedia
<Nistur> I guess it needs fixing :P
<Nistur> tankf33der: did you find the link on my CV?
<Nistur> or my site?
<tankf33der> on site
<Nistur> ok, I'll update it later :P
<Nistur> I haven't touched my site in YEARS
<Nistur> it still says I'm reading a book which I started about 7 years ago or something :P
<Nistur> to be fair, I never finished that book, because I borrowed it from someone, and had to give it back
<Regenaxer> :)
<arievw2> Nistur: do you use a specific chat client which has that ability?
<Nistur> arievw2: which ability?
<Nistur> ix.io?
<arievw2> Sorry. To log history of chat.
<arievw2> AH. Saw MTSD's answer: https://irclog.whitequark.org/picolisp
<arievw2> There you can select a date and view its #picolisp history ...
orivej has quit [Ping timeout: 248 seconds]
orivej has joined #picolisp
rob_w has quit [Remote host closed the connection]
sriram_ has joined #picolisp
sriram_ has quit [Quit: Page closed]
sriram_ has joined #picolisp
sriram_ has quit [Client Quit]
karswell_ has joined #picolisp
orivej has quit [Ping timeout: 256 seconds]
orivej has joined #picolisp
karswell_ is now known as karswell
arievw2 has quit [Quit: Nettalk6 - www.ntalk.de]
sriram_ has joined #picolisp
<sriram_> If I type '+129 at the REPL I get 129. Is it possible to "escape" the +?
Sriram2 has joined #picolisp
<Regenaxer> Hi sriram_!
<Regenaxer> Long time! :)
Sriram2 has quit [Ping timeout: 260 seconds]
<sriram_> Hi Alex.. yes, a very long time ...on here...though I was always trying to improve my understanding of PL :)
<Regenaxer> Good :)
<Regenaxer> I'm just reading your mail
<sriram_> yes...i wanted to build a simple shell utility ala gnuplot
<sriram_> so that instead of saying (call "ls" "-l") I could say (shell ls -l)
<Regenaxer> ok, I see
<sriram_> (de shell Args (apply 'call (mapcar '((X) (str (cons X))) Args)))
<sriram_> works well for that (after I finished patting myself on the back :) )
<Regenaxer> :)
<sriram_> but when I try to open a file at a specific line (shell vi test.l +125)
<Regenaxer> yes, ok
<Regenaxer> You simply pass it as a symbol (string)
<sriram_> it doesnt work ...i found this was because +125 when read changes to 125
<Regenaxer> ( ... "+125")
<Regenaxer> yes, + and - are part of a number when reading
<sriram_> but then the str function would double the "
<sriram_> (mapcar '((X) (str (cons X))) '(vi ../lib/simul.l "+139"))
<sriram_> -> ("vi" "../lib/simul.l" "\"+139\"")
<sriram_> which is not what i want to pass to call
<Regenaxer> I would not build a sting like this
<Regenaxer> you get problems with other metachars too
<sriram_> so was wondering if it is possible to "escape" the + so reader does not swallow it
<Regenaxer> eg backslash
<sriram_> ah .. could you point me to another way. I tried lit but that is not the one I think?
<Regenaxer> Why not (de shell @ (pass "bash" "-c"))
<Regenaxer> or (de shell @ (pass "sh" "-c"))
<cess11_> Or 'in, 'out?
<sriram_> I will try...the main thing was I wanted to avoid "" around each arg
<Regenaxer> I think my example is wrong
<sriram_> a more natural way e.g (shell head -10 ../../test.l)
<Regenaxer> Perhaps (de shell @ (call "sh" "-c" (glue " " (rest))))
<sriram_> so that the command is typed exactly as on command line
<sriram_> ok I will try that ...but also just for reference..is there a way for the program to "see" the +?
<sriram_> (shell vi ../lib/simul.l +139) sh: XC_edquote@lib/led.l@lib/edit.lcallvimpack+set: No such file or directory
<cess11_> You can use 'pack to assemble the arguments, perhaps that could be a way to add the +.
<Regenaxer> "see" the + is not possible as this is eaten by the reader
<Regenaxer> cess11_, yes 'pack', but 'glue' as above is better to separate the args with spaces
<sriram_> yes that would work fine in general...but in this case I am trying to "paste" something...perhaps from another script. so it would be tedious to replace each + by the pack/glue..
<Regenaxer> I think (shell head -10 ../../test.l) is not the right way
<Regenaxer> especially ../../test.l gives an internal symbol
<Regenaxer> you clobber the namespace if you have many of them
<Regenaxer> So (shell "head" "-10" "../../test.l") is better
<Regenaxer> But then we don't need 'shell' ;)
<sriram_> even if i was converting it to a transient symbol by adding the quote "" around it?
<Regenaxer> (call (shell head -10 ../../test.l) would do
<Regenaxer> It is not converted
<Regenaxer> but *created* as a transient symbol immediately
<Regenaxer> oops, wrong copy paste
<sriram_> yes.. that would be the best... but may be i can replace (call (shell ...)) by shell2 :) so that I can get (shell2 head -10 ../../test.l)
<Regenaxer> I wanted to say:
<Regenaxer> (call "head" "-10" "../../test.l")
<Regenaxer> Well, you *could* do (shell2 head -10 ../../test.l)
<Regenaxer> but this is not useful
<sriram_> yes that was my original starting point. Then I realized if I was making many such calls..maybe even pasting from a script file
<Regenaxer> as this function must be a fexpr then
<Regenaxer> and you cannot pass variable arguments
<sriram_> then adding "" around each argument was tedious. Also I was using it as a learning exercise :)
<Regenaxer> (besides creating internal symbols)
<sriram_> so to clarify
<Regenaxer> I think such S
<Regenaxer> oops
<Regenaxer> ok?
<sriram_> even if shell is defined as not evaluating its args (de shell Args....)
<Regenaxer> yes, this is not useful
<Regenaxer> as you must hard-code the calls
<sriram_> the reader creates the internal symbols on reading the (shell head -10 filename)
<Regenaxer> right
<Regenaxer> I would simply call (call "sh" "-c" "head -10 filename")
<Regenaxer> or (call "sh" "-c" (pack "head " Lines " " MyFile))
<sriram_> yes...or even abstract (call "sh" "-c" Str) into (shell Str)
<Regenaxer> so 'Lines' and 'MyFile' are variables
<Regenaxer> yes, good
<Regenaxer> (de shell (Str) (call "sh" "-c" Str))
<sriram_> yes that may be fine...because then i have to quote and unquote only once for the entire command
<sriram_> perfect
<Regenaxer> yep, only once
<Regenaxer> to make it a little more flexible:
<sriram_> yes works nicely now
<Regenaxer> (de shell @ (call "sh" "-c" (glue " " (rest))))
<sriram_> how would the second one be used?
<f8l> Isn’t -n10 the default value?
<Regenaxer> sriram_, the second can be used like the first with one arg
<Regenaxer> or with more args which are the concatenated with spacel
<Regenaxer> f8l, yep, default for 'head'
<sriram_> <f81> yes...but i was just trying to see if it worked with multiple and also numeric args
<sriram_> could have picked a different number for clarity :)
<f8l> I could’ve picked a different screen name for clarity…
<sriram_> i meant i should have used -15 or something to distinguish from the default value
<sriram_> but really didnt care how many lines, just wanted to check that the multiple arguments were getting through
<sriram_> Alex, many thanks...that version works very nicely now
<f8l> And I should have used a letter which doesn’t look like a number in many fonts.
<Regenaxer> Perfect :)
<sriram_> f8l, yes, I mistakenly thought that was a 1 :)
<f8l> What is perfect?
<Regenaxer> I meant "that version works very nicely now"
<f8l> Do I ask too many questions? ;-)
<Regenaxer> Nono, don't worry :)
<Regenaxer> I'm just multitasking here atm
<sriram_> Hi Alex, for the family DB example (family.l)
<sriram_> is it possible to locate the topmost ancestor from the repl
<sriram_> just by browsing the db
<Regenaxer> yes, I don't remember the model exactly, but you can go up the parent links
<Regenaxer> (rel pa (
<Regenaxer> if you only look at fathers, (while (: pa) (setq This @))
<Regenaxer> searching also for mothers, it becomes a tree search
<Regenaxer> You must traverse all branches and return the longest one
<sriram_> I thought initially that (root nm +Person) would do the job
<sriram_> but it is a B-tree so must do as you mention above
<Regenaxer> this is another "tree"
<Regenaxer> The B-Trees index the names
<Regenaxer> and jobs and birthdates etc
<sriram_> oh i see so if I do (root pa +Person) that wont work either
<Regenaxer> the pa and ma are +Joints
<Regenaxer> Let me try
<sriram_> I guess I did not phrase my question correctly. I think I want to find the oldest person in the database
<Regenaxer> this would be 'minKey' on the birthday
<Regenaxer> : (minKey '(dat . +Person))
<Regenaxer> -> (646635 . {A105})
<sriram_> hmm..i am not precise in what i want...:) I mean the person with the earliest birthdate. That would be the earliest ancestor
<Regenaxer> yes
<Regenaxer> : (show '{A105})
<Regenaxer> {A105} (+Man)
<Regenaxer> dat 646635
<Regenaxer> nm "Friedrich Wilhelm III"
<Regenaxer> mate {A104}
<Regenaxer> job "König von Preussen"
<Regenaxer> kids ({A103})
<Regenaxer> fin 672145
<Regenaxer> -> {A105}
<Regenaxer> He is the oldest
<sriram_> (show (cdr (minKey '(dat . +Person)))) {A105} (+Man) mate {A104} nm "Friedrich Wilhelm III" dat 646635 job "König von Preussen" kids ({A103}) fin 672145 -> {A105}
<Regenaxer> yep :)
<Regenaxer> He is the only one:
<Regenaxer> : (collect 'dat '+Person 646635)
<Regenaxer> -> ({A105})
<sriram_> (did you paste each line separately btw? when I paste it all goes on one line)
<Regenaxer> It depends on the copy/paste
<Regenaxer> I'm on Termux/Adroid here
<Regenaxer> If I select with my finger, I get same as you
<Regenaxer> But if I select in tmux with cursor movements, I get a nice formatting
<sriram_> i am using Linux/Terminal .. maybe the browser also may be the issue? Firefox
<Regenaxer> yes, browsers are problematic
<sriram_> i was wondering when reading family.l:main()...why Adam and Eve are created separately
<sriram_> rather than with rest of the persons in the family db
<sriram_> i guess if the db is not present
<sriram_> then a minimal db with adam and eve is created?
<Regenaxer> This is historical I think. Initially there were only 2
<Regenaxer> yes
<sriram_> ok.. thanks Alex...I will continue with reading and exploring the db...:)
<Regenaxer> ok :)
<Regenaxer> Just ask here. When I'm absent, others can help too
sriram_ has quit [Quit: Page closed]
dtornabene has joined #picolisp
cilz has quit [Ping timeout: 256 seconds]
inara has quit [Quit: Leaving]
inara has joined #picolisp
orivej has quit [Ping timeout: 256 seconds]
dtornabene has quit [Remote host closed the connection]
orivej has joined #picolisp