ChanServ changed the topic of #picolisp to: PicoLisp language | Channel Log: https://irclog.whitequark.org/picolisp/ | Check also http://www.picolisp.com for more information
alexshendi has quit [Ping timeout: 257 seconds]
aw- has joined #picolisp
aw- has quit [Client Quit]
yunfan has joined #picolisp
<yunfan> hmm
ubLIX has quit [Quit: ubLIX]
<beneroth> Good morning all
<beneroth> Debian kernel upgrade breaks most ARM SBC: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=922478
<Regenaxer> Hi beneroth
<Regenaxer> uh
<beneroth> might apply to aw- rock64
<beneroth> you got any ARM SBC in use?
<Regenaxer> I dont have. Tested Debian/Arm64 only in Qemu so far
rob_w has joined #picolisp
<rob_w> (gui '(+Button) ,"Set Password"
<rob_w> '(put!> *Login 'pw (passwd (val> (field -1)) (; *Login pw 0)) )
<rob_w> (call "mount" "-o" "rw,remount" "/")
<rob_w> (call "cp" "-rp" "/media/ram/db" "/etc/knock")
<rob_w> (call "mount" "-o" "ro,remount" "/") )
<rob_w> this is what i use to set a password but (trace 'put) doesnt show any action when i press it ?
<beneroth> put is not the same as put>
<beneroth> or put!>
<rob_w> oh
<rob_w> (trace 'put!>) so is that to trace it ?
<rob_w> ah crap
<beneroth> (trace 'put!> '+Entity) or replace +Entity with the class used for *Login
<beneroth> I think
<beneroth> when you trace methods you also have to specify the class
<beneroth> the methods can exist many times
<rob_w> hmm i see
<Regenaxer> rob_w, why don't you modify 'commit' as I suggested yesterday? This would handle *any* change to the DB, even those you may not be aware of now
<Regenaxer> (conc (expr 'commit) '((call "cp" "-rp" ...)))
<Regenaxer> It is called only if there was *really* a change
<Regenaxer> eg if the new value is the same as the old one, it is not executed
<rob_w> hmm ok
<Regenaxer> And yes, 'put', 'put>' and 'put!>' are all separate
<Regenaxer> 'put>' and 'put!>' *do* call 'put' but only if 'has>' says to do so ;)
<Regenaxer> In any case, the *only* place where a physical write to DB files happens is 'commit'
<beneroth> why (conc) instead of (redef) ?
<beneroth> rob_w, yeah changing commit is the best. then code also goes not active if nothing was changed (e.g. a value set which it had before...)
<Regenaxer> 'redef' is optimal, but works only on EXPRs. 'commit'is a SUBR
<beneroth> I have (redef commit (Any . Exe) ... in my code. is this wrong?
<Regenaxer> Does it work? How does 'commit' look afterwards? I.e (pp 'commit)
<Regenaxer> 'redef' modifies the body (list expression) iirc
<rob_w> (conc (expr 'commit)
<rob_w> '((call "mount" "-o" "rw,remount" "/")
<rob_w> (call "mount" "-o" "ro,remount" "/") ) )
<rob_w> (call "cp" "-rp" "/media/ram/db" "/etc/knock")
<beneroth> : (pp 'commit)
<beneroth> (de commit (Any . Exe)
<beneroth> ("commit" Any (car Exe) (cadr Exe)) )
<beneroth> # some additional stuff
<beneroth> always worked for me.
<beneroth> but I never used Ex2 so far
<Regenaxer> Ha, cool! So 'redef' is more powerful than I remembered :)
<beneroth> one just has to take care to keep the original parameter handling intact :)
<beneroth> (same has with messing with T message, haha. I produced much BS my being to eager playing with T method)
<beneroth> the default +Entity T message is so powerful you never want to overwrite it. maybe extend it, but never overwrite/hide it.
<Regenaxer> hmm, right, actually the calls to copy should be in Exe2, so that the DB is still
<Regenaxer> locked
<rob_w> seems working ... why was the previous call not working ? was the event not handled inside ?
<Regenaxer> So my proposal with conc is not optimal
<Regenaxer> Which was the previous version?
<Regenaxer> the put things?
<rob_w> yes
<rob_w> the gui button calling put and the rest of the call()
<Regenaxer> the body of the button is wrong
<beneroth> put> is more involved than you would think :)
<Regenaxer> +Button needs an 'exe', not a 'prg'
<Regenaxer> (gui '(+Button) "title" '(prog (put!> ...) (call ...]
<Regenaxer> But commit is better anyway
<rob_w> ok i see
<Regenaxer> Let me check for a way to get it into Exe2
<rob_w> is my syntax correct .. doesnt look like it '((call ...
<beneroth> Regenaxer, I'm implementing the (upd> '+Entity) method to detect/log changes, which I store in a global. And my redefined commit then takes care to also produce records (well objects) for the log entries before calling standard (commit)
<rob_w> or indentation i mean
<beneroth> exe2 is post-hook
<beneroth> exe1 is pre-hook
<Regenaxer> yes
<Regenaxer> beneroth, so 'redef' is optimal :)
<beneroth> so ideally rob_w works with exe1 (making db writeable) and exe2 (unmounting again), but this means changing every call to commit, so probably a redefine is easier.
<beneroth> agreed.
<Regenaxer> (redef commit (X Exe1 Exe2) (commit X NIL (prog (call))))
<Regenaxer> I think
<Regenaxer> Exe2 is not evaluated iirc
<Regenaxer> So (prog ) is not quoted
<Regenaxer> (commit ['any] [exe1] [exe2])
<Regenaxer> only 'any' is evaluated
<Regenaxer> We might better write then:
<Regenaxer> (redef commit (X) (commit X NIL (prog (call ...) (call ...)))
<Regenaxer> rob_w, can you test this version?
<Regenaxer> or, to get some output:
<Regenaxer> (redef commit (X) (commit X NIL (prog (msg 'committing) (call ...) (call ...)))
aw- has joined #picolisp
mtsd has joined #picolisp
<beneroth> <Regenaxer> only 'any' is evaluated - I noticed, therefore I went for redef commit (Any . Exe)
<beneroth> aw-, Debian kernel upgrade breaks most ARM SBC: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=922478
<beneroth> aw-, might affect your pine?
<beneroth> also, hi aw-, hi mtsd :)
<rob_w> i can .. of course .. hang on after my next tests
<Regenaxer> hi aw-!
<Regenaxer> rob_w, thanks
<rob_w> but beware this is picolisp:3.1.8.15
<rob_w> :)
<Regenaxer> Good that you test such things. It is a new use case for all of us :)
<mtsd> Hi everyone! :)
<Regenaxer> This should be OK. 'commit' did not change for decades
<beneroth> T
<Regenaxer> Hi mtsd!
<Regenaxer> But upgrading anyway might be a good idea
<mtsd> Hi Regenaxer! Everything good?
<beneroth> Regenaxer, why (redef commit (X)) over (redef commit (Any . Exe)) ?
<Regenaxer> I think several bugs were fixed meanwhile
<Regenaxer> With (X) 2nd arg is ignored
<Regenaxer> not even evaluated
<aw-> hi Regenaxer beneroth
<Regenaxer> Does not matter here, because it was never passed in this code
<aw-> beneroth: not affected, I use a custom kernel ;)
<beneroth> rob_w, if you are on pil64 you might get a weird compiling error when you switch, as a new (flood) function was added in the meantime which also quickly became used in the build step. Grab the *.s file for your platform and build with it.
<rob_w> i am not
<rob_w> never was ;-)
<beneroth> aw-, ok :) because of rock64, or because of personal reasons? (I like to know for when I might also start using rock64)
<rob_w> historic .. never change a ..
<beneroth> rob_w, kk. you keep the 32 C-flame burning, well well :)
<rob_w> its a working product , quite finished and no reason to update till now that issues with sdcards slots
<beneroth> agreed :)
<rob_w> well how would i know if its a pil64 anyway ?
<rob_w> any command to test ?
<Regenaxer> (== 64 64)
<Regenaxer> gives T if on pil64
<Regenaxer> or look at *CPU
<Regenaxer> is NIL in pil32
<rob_w> ok hang on installing the new version atm
<Regenaxer> great!
<rob_w> NIL -> pil32
<Regenaxer> ok
<rob_w> tests with (redef .. ) feel correct !
<rob_w> one more question .. as i start my process via +main +go ... i can assume that (de main ... is called before (de go ... right =
<aw-> beneroth: depends what OS you choose
<rob_w> ?
<Regenaxer> cool!
<Regenaxer> yes, calls are left to right
<aw-> beneroth: some OS have latest kernel, some have older kernel.
<rob_w> but are those forks() in some sort so will +go be called immidiatly after the call to +main ?
<rob_w> or will +go be called after +main finishes ?
<beneroth> aw-, ok, so not because of the hardware :) thx
<beneroth> (not because hardware requires custom built kernel, I mean)
<beneroth> (nvm)
<rob_w> .. and i mean -main -go of course
<aw-> beneroth: i don't know anyone dumb enough to update their Linux kernel without having a fallback in case it doesn't boot
<aw-> so these kind of issues are so minor, not worth reading
<Regenaxer> rob_w, it is sequential. After (main) returns (it is a function), (go) is called
<Regenaxer> Like if you call (main) (go)
<beneroth> aw-, you are right. Thanks for the hint.
<aw-> beneroth: maybe wait a few months for rock64 if you want one, the next revision will have PoE and an RTC embedded
<beneroth> oh nice
<beneroth> It might easily take some more months until I can look into it anyway xD
<yunfan> what happened?
<yunfan> i was kicked from the channel before
<yunfan> btw, what do you guys thinks of the new coming lisp lang janet?
<beneroth> yunfan, no idea what happened, I cannot find when you left, I see you logged in nearly 8 hours ago
<rob_w> aw-: sounds like some hardware involved ?
<beneroth> yunfan, you've got some good links about janet?
<rob_w> beneroth: right in my ballpark .. nice
<beneroth> I know it from aw-
<beneroth> he replaced a desktop with it :)
<aw-> rob_w: yes, my main workstartion for the last year
<tankf33der> o/
<beneroth> tankf33der, \o
<tankf33der> i like this art
<rob_w> what are u booting on that aw- ?
<yunfan> beneroth: i had been kicked days ago, when i went to thailand for trip during the chinese new year
<beneroth> tankf33der, nice! T
<beneroth> yunfan, no idea. maybe just freenode server disconnect or so. nothing special happened as far as I noticed.
<beneroth> yunfan, you can always use the log at: https://irclog.whitequark.org/picolisp/
<yunfan> beneroth: https://janet-lang.org/ here is it
<aw-> rob_w: i'm running Debian Stretch (9.0)
<rob_w> sweet
<beneroth> yunfan, thanks
<Regenaxer> tankf33der, right! ASCII art rules
* rob_w wonders if there is a $MACHINE for it in yocto
<aw-> Regenaxer: indeed
<yunfan> and after fouding its tiny size and rich features, i reminds picolisp :D
<Regenaxer> I made a plugin for VIP which generates ASCII boxes from s-exprs
<Regenaxer> still working on it
<aw-> I use this for making my ascii diagrams: https://github.com/lewish/asciiflow2 - example here: http://asciiflow.com/
<Regenaxer> For example, this code http://ix.io/1BsT
<aw-> it's possible to run it locally only with the index.html and the javascript file
<Regenaxer> gives http://ix.io/1BsV if I hit 'v' in Vip
<aw-> just remove the analytics and other junk from index.html
<Regenaxer> yunfan: It is always good to see that Lisp is alive
<Nistur> mornin' all
<yunfan> Regenaxer: does picolisp have a bytecode vm underlying?
<Regenaxer> Hi Nistur
<Regenaxer> yunfan, no
<Regenaxer> only emu
<Regenaxer> but 16 bit words, not bytes
<yunfan> well same concept
<Regenaxer> still different, as pil does not compile code. I think what you mean is byte-code compiling
<yunfan> yep
<Nistur> o7
<Regenaxer> So it is kind of, as emu in compiled from generated C code
<Regenaxer> but only the binary, not user code
<yunfan> wow i see tankf33der were in their channel
mtsd has quit [Quit: WeeChat 1.6]
ubLIX has joined #picolisp
alexshendi has joined #picolisp
orivej has quit [Ping timeout: 246 seconds]
<tankf33der> i would like to sell very old piano, any sites like craiglist to post on it?
<Nistur> I would like to buy an old piano
<Nistur> but I don't have the space for it, nor can I play it... :P
<Nistur> also the specific piano I would like is not particularly easy to come by
ubLIX has quit [Quit: ubLIX]
rob_w has quit [Remote host closed the connection]
xkapastel has joined #picolisp
aw- has quit [Quit: Leaving.]
alexshendi has quit [Ping timeout: 246 seconds]
xkapastel has quit [Quit: Connection closed for inactivity]
ubLIX has joined #picolisp
alexshendi has joined #picolisp
ubLIX has quit [Quit: ubLIX]
xkapastel has joined #picolisp
orivej has joined #picolisp
alexshendi has quit [Ping timeout: 258 seconds]
ubLIX has joined #picolisp
xkapastel has quit [Quit: Connection closed for inactivity]
ubLIX has quit [Quit: ubLIX]