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
theruran has joined #picolisp
<abu[7]> Now I think I found what the real problem was with non-symbolic tasks
<tankf33der> morning
<tankf33der> super
<abu[7]> This was never used before :)
<tankf33der> i knew you can
<abu[7]> But this does not explain what the problem yesterday was, because this was also with symbolic tasks where this code was not even called
<tankf33der> infinity and beyond
<abu[7]> My simple tests here passed, also on Debian
<tankf33der> i have 30mins
<abu[7]> I'll release now
<tankf33der> debian, alpine, freebsd, archlinux - ok
<tankf33der> now playing with -O3
<abu[7]> OK. Cool!
<abu[7]> I think I feel better with -O2 ;)
<tankf33der> issue is here, lets leave it alone.
<tankf33der> now testing old-new tests with co and will add to bundle if ok
<abu[7]> Yes, very good
<tankf33der> passed.
<abu[7]> And if you have more ideas for abnormal use cases, please try ;)
<abu[7]> So it looks a lot better today
<abu[7]> Then a week ago
<tankf33der> Let's assume that the coroutine adventures have come to an end.
<abu[7]> ok
<tankf33der> afk
<abu[7]> We added sanity checks and fixed some bugs
<abu[7]> Thanks for all the help!
geri has joined #picolisp
<geri> hoi
<geri> got this now https://0x0.st/XATy.l
<geri> and sh version https://0x0.st/XATv.sh
<abu[7]> Hi geri!
<abu[7]> (apply Exec (rest)) is better (pass Exec)
<abu[7]> (rest) builds a list first
<geri> aighty
<geri> i wanted to call Exec and Exec& "!" and "&" but both are already defined
<abu[7]> T
<geri> also using a case statement for matching on file extension is way nicer than what i had before
<abu[7]> Upper case is fof locally bound symbols though
<abu[7]> for*
<geri> well, it's script-local
<geri> :D
<abu[7]> T, but globally bound in the script
<abu[7]> But no probled
<abu[7]> q
<abu[7]> m
<geri> probledqm!
<abu[7]> In a small script you are free
<abu[7]> ☺
<geri> i only started doing them with capitals cause text is a builtin already
<abu[7]> Yek, I thought so
<geri> is there a neat way to define a key of alist to be same as another one?
<abu[7]> I sometimes to (setq Var in a script
<abu[7]> How another?
<geri> i basically want to do the same thing as i do with de Image ~Video but if everything is stored in an alist
<abu[7]> The keys are checked with '=='
<abu[7]> No
<abu[7]> assoc uses '='
<abu[7]> asoq uses '=='
<abu[7]> T thought you talk about properties
<geri> (de Apps
<geri> (video (F) (Exec& "mpv" "--no-terminal" "--" F))
<geri> (image ...)) # should refer to video
<geri> like this
<geri> i dont wanna do let's, its ugly
<abu[7]> Hmm, I don't understand what you want to do
<abu[7]> Which alist?
<geri> (de Video (F) (Exec& "mpv" "--no-terminal" "--" F))
<geri> (de Image ~Video)
<geri> but instead its all stored in one alist
<abu[7]> asoq in one single function?
<geri> uh
<abu[7]> (Apps 'video ... ?
<geri> in other lang lingo - just make a hash table storing functions, but somehow refer to another key when defining it?
<geri> ill probably just rename all those opening functions though
<geri> just curious
<geri> i keep on hacking on my pil rewrites for sh scripts but i cant seem to commit to it haha
<abu[7]> geri, btw, TAB expansion for "@" now works also on the top level directory
<tankf33der> abu[7]: testing This in co-yield
<tankf33der> if i comment yield T prints two times
<tankf33der> is it good test if i understood problem correctly
<abu[7]> More interesting is perhaps if the yield is *in* the 'let'
<tankf33der> i have tried with setq
<tankf33der> with the same result
<abu[7]> T, setq does not hold the value in the co frame
<tankf33der> the same result with let
<abu[7]> co local are locally bound syms, i/o catch etc,
<abu[7]> global is global
<abu[7]> Did you expect something different?
<abu[7]> 'This' is a normal symbol like any other. It is just used implicitly at certain places
<tankf33der> sure
<tankf33der> why it is NIL after yield call ? :/
<abu[7]> Good question
<tankf33der> ref says:
<tankf33der> The initial value of This is bound and preserved in the coroutine environment.
<abu[7]> I think not
<tankf33der> so i am decided to play with This values
<abu[7]> This is not in the co frame
<abu[7]> I'm shopping, Will take a look later
<tankf33der> thanks.
<tankf33der> afk
<geri> abu[7]: about @Tab very nice!
<abu[7]> ☺
<abu[7]> tankf33der: While waiting at the supermar(et, I understood the reason. 'This' is part of the env, and because 'a' terminates after the 'yield' and 'with', it restores the env of the originator (here T) to what it was when it was called (This was NIL at that time)
<abu[7]> The question is if This should be part of the enw
<abu[7]> env
<abu[7]> But what about other parts of the env?
<abu[7]> I did not think much about terminating co's asynchronously
<abu[7]> ie. starting in one env and stopping in another
<abu[7]> OK, I see that $This is not part of the llvm~env, good so.
<tankf33der> Not bug, ok
<abu[7]> Well, not sure
<abu[7]> I'm still out
<abu[7]> Will investigate why This is overwritten on co exit
<tankf33der> Thanks
<abu[7]> (other vars are no)
<abu[7]> not
<tankf33der> tested, other syms are ok
<abu[7]> T
<abu[7]> T
<abu[7]> I don
<abu[7]> 't understand
<abu[7]> why this is so :)
<abu[7]> Ah, I see!
<abu[7]> (push (val $This) $This ... in 'co'
<abu[7]> It is handled explicitly
<abu[7]> Not a good idea perhaps
<abu[7]> Makes no sense to me now
<abu[7]> I'll meditate about removing it
<abu[7]> It was added 31aug23
<abu[7]> I have even code that relies on it
<abu[7]> It is very useful when coroutine tags are OOP objects
<abu[7]> ie. implicit 'This' like in methods
<abu[7]> Unsatisfactory ...
<geri> nice and bloated
<geri> B)
<geri> i wrote another impl in guile scheme and its like 1 line shorter, probably because of docs lol
<geri> (i also wrote one in cl, gauche, clojure & pure sh :))
<abu[7]> 👍
<geri> gotta write one in janet, why not
<geri> have you heard about it?
<abu[7]> nyet
<geri> is that russian? :D
<geri> its an array-based lisp
<geri> ie not a lisp at all
<geri> its for scripting, but its got the immutability shtick so you probably wont like it at all
<abu[7]> I see
<abu[7]> yes, russian, but I don't speak any ;)
<geri> im a native B)
<abu[7]> Oh, cool
<abu[7]> That's why you are up so early
<geri> nah, i just wake up at 5 am every day
<geri> im in eastern eu
<abu[7]> ☺
<tankf33der> I am russian
<abu[7]> T
<tankf33der> geri: and maybe from your country
<geri> more likely that we're neightbours
<geri> unnecessary t :(
<abu[7]> ab
<abu[7]> oops
<geri> (de termuxify (Opener)
<geri> (if (= Opener editor)
<geri> (if (sys "TERMUX_VERSION")
<geri> Opener
<geri> '((F) (exec! "termux-open" F)))
<geri> Opener))
<geri> that's right now
<geri> (de termuxify (Opener)
<geri> (or
<geri> (and (sys "TERMUX_VERSION")
<geri> (not (= Opener editor))
<geri> '((F) (exec! "termux-open" F)))
<geri> Opener))
<geri> that's an experiment
<geri> :D
<geri> first one probably a little clearer
<geri> and with proper formatting the logic chain one is 1 line longer
<abu[7]> Yeah, I always feel uneasy upon 'not'
<abu[7]> ok, here '<>'
<tankf33der> not = comes from lisp books
<tankf33der> this is insane
<abu[7]> T
<abu[7]> tankf33der: I thi
<abu[7]> nk I understand the This issue
<abu[7]> It is special on 'co' entry
<abu[7]> so it should be handled on exit too
<abu[7]> (not sure how, will find out)
<tankf33der> ok
<geri> (not (= ...)) is fine
<geri> i couldnt remember how the opposite was called
<abu[7]> >> ok, here '<>'
<geri> most lisps dont have like half of predicates you got lol
<geri> and inverted ones just remove a set of parens, logically they dont really do anything other than (not (=...)) and the likes
<abu[7]> In an interpreter they are important
<abu[7]> Func calls are expensive
<abu[7]> bench '(not A)' against just 'A'
<geri> (not A) => 0.013 - 0.035 sec, A => 0.006 - 0.015 sec
<geri> huh
<geri> if its 'A vs (not 'A) its very similar
<geri> where does <> symbol come from?
<geri> damn
<abu[7]> eg, Basic used <>
<geri> aighty, no wonder i didnt know
<geri> i honestly really like using (quote ...) syntax for defining functions instead of using the shortcut, feems homey
<abu[7]> ok :)
<geri> there's no point, its more symbols, but it just feels right haha
<geri> aighty, gotta go
<geri> have fun
<abu[7]> Good night geri!
<abu[7]> tankf33der, I think I have it
geri has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.3)]
<abu[7]> Released :)
<tankf33der> playing
<abu[7]> Thanks as ever for finding this!
<tankf33der> o/
<abu[7]> Now it is more correct
<abu[7]> It was even a bug I think
<tankf33der> alpine - crashed
<tankf33der> debian - ok
<abu[7]> oh!
<abu[7]> Maybe diffenent stack layout
<tankf33der> this new machine, checking ulimit settings
<abu[7]> I try indire6t pointers
<tankf33der> with unlimited co is ok
<abu[7]> Ah, good
<abu[7]> Did it use really so much stack?
<tankf33der> default 8k is too small
<abu[7]> I see
<abu[7]> tankf33der, ao you are a Latvian citizen in the russian minority?
<tankf33der> i am Latvian alien
<tankf33der> as written in my passport
<abu[7]> You have russian nationality?
<abu[7]> or both?
<tankf33der> on Latvian semi citizen status
<tankf33der> on -> only
<abu[7]> strange, semi
<tankf33der> because i was born in soviet union
<abu[7]> So now they should give you full status
<tankf33der> i must know Latvian language, but i am very stupid for languages
<abu[7]> ah :)
<tankf33der> This inside co tested, works
<abu[7]> My son in law is Canadian, he had to pass a German lang test last week to have less problems with residence permission
<abu[7]> Great!!!
<abu[7]> Co's get better and better
<tankf33der> afk
<abu[7]> o/