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
alexshe72 has quit [Quit: -a- Connection Timed Out]
alexshendi has joined #picolisp
alexshendi has quit [Quit: -a- Connection Timed Out]
alexshendi has joined #picolisp
alexshendi has quit [Quit: -a- Connection Timed Out]
alexshendi has joined #picolisp
alexshendi has quit [Quit: -a- Connection Timed Out]
alexshendi has joined #picolisp
razzy has joined #picolisp
razzy has quit [Ping timeout: 268 seconds]
alexshendi has quit [Quit: -a- Connection Timed Out]
alexshendi has joined #picolisp
razzy has joined #picolisp
alexshendi has quit [Quit: -a- Connection Timed Out]
alexshendi has joined #picolisp
razzy has quit [Ping timeout: 252 seconds]
razzy has joined #picolisp
alexshendi has quit [Quit: -a- Connection Timed Out]
alexshendi has joined #picolisp
alexshendi has quit [Quit: -a- Connection Timed Out]
alexshendi has joined #picolisp
razzy has quit [Ping timeout: 265 seconds]
razzy has joined #picolisp
alexshendi has quit [Quit: -a- Connection Timed Out]
alexshendi has joined #picolisp
razzy has quit [Ping timeout: 252 seconds]
razzy has joined #picolisp
razzy has quit [Ping timeout: 260 seconds]
aw- has quit [Ping timeout: 268 seconds]
razzy has joined #picolisp
razzy has quit [Ping timeout: 268 seconds]
razzy has joined #picolisp
razzy has quit [Ping timeout: 260 seconds]
razzy has joined #picolisp
razzy has quit [Ping timeout: 260 seconds]
razzy has joined #picolisp
razzy has quit [Ping timeout: 252 seconds]
razzy has joined #picolisp
<razzy> Regenaxer: I finally moved with my history trouble. by itself commands work as expected, but when starting with ./pil rc + , it erases .pilrc ttps://paste.rs/WLC
<Regenaxer> hmm, you write to ".pilrc"
<Regenaxer> I know I told you to write to "+.pilrc" in *Bye, but here this is not useful
<Regenaxer> all that uniq calls should not be necessary
<razzy> + appends to file
<razzy> it is usefull
<razzy> yes, too many uniq calls
<Regenaxer> yes, so you get the same history over and over again
<razzy> after start, it makes .pilrc blank
<razzy> no history in
<Regenaxer> Also, (mapc prinl is not correct
<Regenaxer> History is a list of strings
<Regenaxer> (mapc prinl writes lines
<Regenaxer> I would simply do (push1 '*Bye '(out "+.pilrc" (mapc println (history))))
<Regenaxer> or (mapc println (diff (history) *OldHistory)) perhaps
<Regenaxer> hmm, no, sorry!
<Regenaxer> I said wrong
<Regenaxer> (mapc prinl is fine
<razzy> I value your println input. but i do not think it solves problem. problem is after pil rc + it erases insides of .pilrc
<razzy> which imho it should not
<Regenaxer> right
<Regenaxer> (out "+.pilrc" appends
<razzy> which i want
<Regenaxer> Why do you do (out ".pilrc" (mapc prinl (history))) ?
<Regenaxer> This writes new
<razzy> yes
<Regenaxer> and then in *Bye you append
<razzy> because i do not want to loose history when I open multiple pil
<Regenaxer> OK, anyway this works: (push1 '*Bye '(out "+xxx" (prinl "OK")))
<Regenaxer> Can you debug where and when exactly it is erased?
<razzy> every command work separate ok
<Regenaxer> "+.pilrc" definitely appends
<Regenaxer> so find the place
<Regenaxer> where / when
<razzy> i do not know how
<Regenaxer> Single stepping
<razzy> hmm, and checking the file with every step;
<razzy> will do
<Regenaxer> exactly
<Regenaxer> at which moment is it erased?
<Regenaxer> I do not want to test it here :)
<Regenaxer> destroying my .pilrc
<razzy> :D
<Regenaxer> I always edit it manually with Vip
<razzy> after start. i will step through commands
<Regenaxer> Is everything still there just before pil exits?
<razzy> yep
<razzy> I will step through rc
<Regenaxer> good, thanks!
<Regenaxer> Must be some simple reason
<Regenaxer> I think I know!
<Regenaxer> (out ".pilrc" (mapc prinl (history))
<Regenaxer> This is running while it is still being read
<Regenaxer> (when (info ".pilrc") (in @@
<Regenaxer> So you write it while the file is still open
<Regenaxer> I think this (out ".pilrc" (mapc prinl (history))) shoul not be needed
<Regenaxer> Why write it here?
<Regenaxer> Not sure, well, reading is finished when you call that
<Regenaxer> Can you omit that line and see what happens?
<Regenaxer> also this: (history (uniq (history)))
<razzy> will do
<Regenaxer> The history is still being read and set
<Regenaxer> (history (make ...
<Regenaxer> So it is a big mess of reading and writing
<razzy> i see
<razzy> yep (out ".pilrc" (mapc prinl (history))) erases it
<Regenaxer> I would only do (push1 '*Bye '(out "+.pilrc" (... in .pil/rc
<Regenaxer> Not (history (uniq (history))) because the history is just now being built
<Regenaxer> and not write to .pilrc, because it is just being *read*
<razzy> ok, thx
<Regenaxer> And keep it simple
<Regenaxer> remember several pil processes might run
<Regenaxer> so they all read and write here
<Regenaxer> Best is just do *Bye with appending
<razzy> simple would be have separate file for global and local history imho
<Regenaxer> *IF* you want uniq, do it on top in the (history (make ...
<Regenaxer> We do have separate files
<Regenaxer> .pil/rc is global
<Regenaxer> .pilrc is directory-local
<Regenaxer> But there may still be many processes running
<Regenaxer> and *are* if yuu use a DB application
<razzy> conclusion: i will ommit problem line for now. I will have very messy .pilrc. for future i plan ./rc for loading ./pilrc-local ./pilrc-global
<Regenaxer> OK, sounds good
<razzy> Regenaxer: I think .pilrc should not be open when ##Initial commands are starting. can it be close by ommiting line (while (read) (eval @))?
<Regenaxer> yes
<Regenaxer> or you read all (read) items into a list
<Regenaxer> then 'run' that list
<Regenaxer> You can take a look how pil64 did the history
<Regenaxer> there was no readline()
<Regenaxer> I think it simply did the (diff) above
<Regenaxer> i.e. on *Bye write all lines *not* yet in the history file
<Regenaxer> this worked fine with multiple processes
<Regenaxer> IIRC it used 'ctl' to lock the file while writing
<Regenaxer> It is the file @lib/led.l in the old pil distro
<Regenaxer> At start it does
<Regenaxer> (in (pack "+" (pil "history"))
<Regenaxer> (make (until (eof) (link (line T)))) )
<Regenaxer> stores that in *History
<Regenaxer> to remember it
<Regenaxer> and "Hist0"
<Regenaxer> so Hist0 is the original
<Regenaxer> then on exit
<Regenaxer> (unless (= *History "Hist0")
<Regenaxer> (out (pil "history")
<Regenaxer> (mapc prinl *History) ) ) )
<razzy> now it works ok, without 2 lines of code :) I am happy
<Regenaxer> Great :)
razzy has quit [Ping timeout: 265 seconds]
razzy has joined #picolisp
<razzy> Regenaxer: now i m using this http://ix.io/3zga/text it works. maybe i shot myself. I do not see how.
<razzy> i agree that for future i should do cleanup in (make
<Regenaxer> Hmm, if you do # (while (read) (eval @))
<Regenaxer> ie comment it, the initial commands are not executed
<Regenaxer> is that desired?
<razzy> they are executed
<Regenaxer> true
<Regenaxer> .pil/rc is 'load'ed
<Regenaxer> But not the ones from ".pilrc"
<razzy> no, .pilrc is just history for me
<Regenaxer> ok, then fine
<Regenaxer> I use .pilrc to execute debugging commands for that project (directory)
<razzy> I now see why it is that way.
<Regenaxer> Any way is ok, everybody is free to do whatever in the rc files
<razzy> I was thinking that everybody will benefit from my change, but now i see that is not the case.
<Regenaxer> I think some people might benefit
<Regenaxer> showing different possibilities
<Regenaxer> My plan was to hake the distributed version just have the minimal, general way: 'loading' the file ~/.pil/rc
alexshendi has quit [Read error: Connection reset by peer]
alexshendi has joined #picolisp
alexshendi has quit [Read error: Connection reset by peer]
<razzy> i see potential. I think there are several options to do it. Current ./rc is too much convoluted, not transparent for my skill :). When given a choice, I opt for one big pile with good search algorithms. hence one history file :]
alexshe86 has joined #picolisp
stultulo has joined #picolisp
f8l has quit [Ping timeout: 252 seconds]
razzy has quit [Ping timeout: 252 seconds]
razzy has joined #picolisp
alexshe86 is now known as alexshendi
razzy has quit [Ping timeout: 265 seconds]
razzy has joined #picolisp
razzy has quit [Ping timeout: 260 seconds]
alexshe81 has joined #picolisp
alexshendi has quit [Read error: Connection reset by peer]
alexshe81 has quit [Read error: Connection reset by peer]
alexshendi has joined #picolisp
aw- has joined #picolisp
aw- has quit [Client Quit]
aw- has joined #picolisp