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
geri has joined #picolisp
<geri> hey, looks like i managed to write a proper indent function
<geri> tell me if anything seems logically wrong :D
<geri> well, it doesn't do the "if size of car is more than 12, go to next line" thing
<geri> just indentation
<abu[7]> Sounds good :) I cannot say anything though, as I have absolutely no idea about emacs
<geri> its okay, functions are named pretty descriptively
<geri> just check last block
<geri> basically if theres more open parens than closing ones, indent the line to level of previous line + 3, if theres more closing ones, -3 and otherwise at the same level
<abu[7]> How about parens in strings and/or (possibly nested) comments?
<geri> oh good catch
<geri> lets see..
<geri> yeah, borks it
<geri> if you add a lone closing paren into a string
<geri> and just adding parens to strings adds indentation
<geri> okay thanks
<abu[7]> Just to be perfect :)
<geri> yee
<geri> i dont want it to be annoying either
<geri> plus its a fun project anyway
<abu[7]> Sure :)
<geri> how do i check if im looking at a string or not, hmmm
<abu[7]> pilPretty also does not handle that
<geri> ahaha
<geri> amazing
<abu[7]> That's why I removed it perhaps
<abu[7]> Vip is correct
<geri> well its probably gonna increase complexity quite a bit
<abu[7]> Yeah
<abu[7]> Vip keeps proper info for the state of each char
<abu[7]> Each char is a symbol
<geri> it has to be run at the beginning of sexp 100% of the time though, no?
<geri> otherwise it can only know state of following lines
<abu[7]> Yes, the whole file is marked up all the time
<geri> i mean it seems only to*
<geri> vip doesnt autoindent, no?
<geri> or does it
<abu[7]> Not "auto", only if you hit comma
<geri> i meant you have to run comma on beginning of sexp to get proper indentation
<abu[7]> T
<geri> im so traumatized by dw deleting with inclusion
<geri> xd
<geri> i know its like simpler like that but trauma is real
<abu[7]> Hmm, what do you mean with "deleting with inclusion"?
<geri> deletes up to beginning of text including the first character
<geri> im really bad at talking today
<abu[7]> I see, yes, differs from VI
<geri> im honestly surprised you were a vim user and not like an nvi user
<abu[7]> So "de" or "dE"
<geri> or busynox vi
<geri> :d
<geri> busybox*
<geri> :D*
<geri> i use dw to delete indentation often
<geri> so all the spaces but nothing else
<geri> hence the trauma
<abu[7]> This does TAB in Vip
<abu[7]> Move *till* non-white
<geri> i need not to move but delete all whitespace until text stards
<geri> i cant type xd
<abu[7]> The fundamental principle of VI
<abu[7]> Move
<abu[7]> All those commands are based on move
<abu[7]> ce
<abu[7]> de
<abu[7]> ye
<abu[7]> etc
<abu[7]> Edgting *is* move
<abu[7]> Editing
<geri> that's not what i meant i wanna do 🤧
<geri> imagine you wanna delete all indentation completely in task function in lib.l
<abu[7]> <}
<geri> its not efficient but id usually just spam dw followed by j until its done or use :s
<abu[7]> You do "<}" several times
<geri> okay great
<geri> 99999<}
<abu[7]> yes
<abu[7]> or "<G"
<abu[7]> till eof
<geri> wait it seems to indent 99999 following lines by one level lol
<geri> well idea is understood anyway
<abu[7]> You can repeat with "."
<geri> oh yeah
<abu[7]> Usually I do "<%" for one s-expr
<abu[7]> or just "," in the end
<abu[7]> I don't write code line by line usually, but fragments here and there, that's why I don't want the editor mess up my code while I type by auto-indenting it
<geri> it can be annoying if you got adhd and cant close stuff you written above before writing something new haha
<abu[7]> T :)
alexshendi has joined #picolisp
alexshe51 has quit [Ping timeout: 255 seconds]
geri has quit [Remote host closed the connection]
alexshendi has quit [Ping timeout: 268 seconds]
alexshe30 has joined #picolisp
alexshe30 has quit [Read error: Connection reset by peer]
alexshendi has joined #picolisp
alexshe30 has joined #picolisp
alexshendi has quit [Read error: Connection reset by peer]
alexshe30 has quit [Read error: Connection reset by peer]
alexshendi has joined #picolisp
alexshe30 has joined #picolisp
alexshendi has quit [Ping timeout: 268 seconds]
alexshe30 has quit [Read error: Connection reset by peer]
alexshe43 has joined #picolisp
alexshe43 has quit [Read error: Connection reset by peer]
alexshendi has joined #picolisp
alexshendi has quit [Read error: Connection reset by peer]
alexshendi has joined #picolisp
alexshe29 has joined #picolisp
alexshendi has quit [Ping timeout: 260 seconds]
alexshe29 has quit [Read error: Connection reset by peer]
alexshendi has joined #picolisp
tankf33der has joined #picolisp
tankf33der has left #picolisp [#picolisp]
alexshe0 has joined #picolisp
alexshendi has quit [Read error: Connection reset by peer]
chexum has quit [Ping timeout: 260 seconds]
chexum has joined #picolisp
alexshendi has joined #picolisp
alexshendi has quit [Read error: Connection reset by peer]
geri has joined #picolisp
alexshe0 has quit [Ping timeout: 255 seconds]
alexshendi has joined #picolisp
<geri> hey, have you ever touched/seen common lisp + SLIME combo?
<geri> abu[7]:
<geri> or maybe you can rewrite currently running loop with picolisp and im just ignorant and it doesnt need this
<abu[7]> Hi geri! Yes, a short time, about 12 years ago
<geri> how'd you like it?
<abu[7]> Horrible ;)
<geri> how so?
<abu[7]> CL is huge and ugly
<geri> well that's a CL issue
<geri> im asking about SLIME in particular
<abu[7]> I dont remember slime well
<abu[7]> I think I used evil (?)
<geri> basically you run a cl image and you can connect to it with emacs to hack on time in real time
<geri> the loop example i was talking about - you can do (loop (function)) and redefine (function) in real time via your editor
<geri> and its gonna work and update properly
<abu[7]> Like in Vip too
<geri> how?
<abu[7]> Well, the function must cooperate
<abu[7]> eg a tas(
<abu[7]> task
<abu[7]> Vip runs as a caroutine
<abu[7]> Pil has no threads
<geri> im not very knowledgeable about coroutines
<geri> can you give a practical example of redefining a function in real time while its getting called in a loop elsewhere?
<geri> just something smol and silly is fine
<abu[7]> While a loop is running, it does not work
<abu[7]> But a task does
<abu[7]> (task -6000 0 (foo))
<abu[7]> Then modify foo
<abu[7]> (de foo () (msg 1))
<abu[7]> (de foo () (msg 2))
<abu[7]> ...
<geri> okay that's cool
<geri> now just gotta figure out tasks :D
<abu[7]> A more typical case is modifyin
<abu[7]> g th GUI while it runs
chexum has quit [Ping timeout: 260 seconds]
<geri> what's the function to open gui?
<geri> (or did i misunderstand)
<abu[7]> I connect to a running production app with
chexum has joined #picolisp
<abu[7]> $ psh name
<abu[7]> or $ psh 8086
<geri> oh i gotta install it in my package too
<abu[7]> psh ?
<geri> ye
<abu[7]> it is just a script
<geri> i only got pil, picolisp and vip so far
<abu[7]> ok
<geri> yes, i mean in my nix package
<abu[7]> yes
<abu[7]> it is bin/psh
<geri> oki doki
<abu[7]> Modify the hashbang?
<geri> i just called it with pil directly
<geri> complains about ~/.pil/pw not being a thing
<abu[7]> Go
<abu[7]> od
<abu[7]> grr
<geri> :D
<abu[7]> pw is a shared secret
<geri> hmmm
<abu[7]> (vi 'pw)
<abu[7]> You can call once (pw 12)
<geri> yeah its trying to read from pw file and back in or something
<geri> oh wait it takes an arg xd
<abu[7]> optionally
<abu[7]> (pw 12) creates one
<geri> i mean, every argument is optional over here
<abu[7]> T
<abu[7]> Just (pw) ret
<abu[7]> urns it
<geri> had to run pw 12 and then pw would work
<abu[7]> yes
<geri> now i just gotta start up picolisp server on some port
<abu[7]> You could try the demo app
<abu[7]> Same as https://picolisp.com/app
<geri> oki, very nice
<abu[7]> Login admin/admin :)
<geri> ahaha
<geri> okay great
abu[7] has left #picolisp [#picolisp]
abu[7] has joined #picolisp
<abu[7]> Locally I start it as
<abu[7]> $ PORT=8086 ./pil app/main.l -ap~main @lib/too.l -go +
<abu[7]> Then the browser at http://localhost:8086
<geri> hell yeah
<geri> pressing login redirects me to http://localhost:60921/22228956060957757~!work?*Menu=+3&*Tab=+1&*ID=&*Evt=+1&*Got=_+3_+1
<geri> hmmm
<abu[7]> Correct
<abu[7]> This is how sessions are encoded
<abu[7]> I think you tried the family db, it work the same way
<geri> trying to try redefining (de work ...) to change PicoLisp App on home page to be "My PicoLisp App" for testing but nothing seems to change
<abu[7]> work is loaded at startup
<geri> aw
<geri> what can i try redefining?
<abu[7]> try (vi 'work) and then :l
<abu[7]> :l saves and loads
<geri> still nothing changes hmmmm
<geri> i psh'd into the running demo app
<abu[7]> Ah, no
<abu[7]> on the repl
<geri> oh wait right
<geri> only redefine tasks or something
<abu[7]> psh starts a new session
<geri> new session = you cant redefine stuff?
<abu[7]> You can, but things loaded at startup are not changed in already running sessions
<abu[7]> In a pil app some files are loaded in main.es
<abu[7]> main.l
<abu[7]> others are loaded at runtime
<abu[7]> those can be changed and then are visible also in running other sessions
<geri> hmm
<abu[7]> e.g. (vi "app/cusu.l")
<abu[7]> Then refresh the browser
<abu[7]> In main.l:
<abu[7]> (load "app/er.l" "app/lib.l" "app/gui.l")
<abu[7]> So these files don't change in running sessions
<geri> ah
<abu[7]> 'work' is in gui.l
<geri> im stupid - where is cusu.l actually rendered? xd
<abu[7]> When you click on "customers" in the menu
<geri> oh uh
<abu[7]> Customers/Suppliers
<geri> admin admin doesnt work here
<geri> to log in
<abu[7]> oh
<abu[7]> the initial DB is in app/init.l
<abu[7]> (obj ((+User) nm "admin") pw `(pass ...
<abu[7]> so admin/admin should work
<geri> i get a Permission Denied
<abu[7]> Do these users exist?
<geri> nope
<geri> maybe i messed something up in the run command
<abu[7]> Just delete the db dir and start new
<geri> PORT=8086 pil app/main.l -ap~main @lib/too.l -go
<geri> db dir exists...
<geri> lets purge it rq
<abu[7]> rm -r db/app
<geri> oh wait right
<geri> no libcrypt.so
<geri> my bad
<abu[7]> ah
<geri> nix being itself
<abu[7]> Understandable
<geri> sometimes its amazing and sometimes it sucks :D
<geri> at least i know where to look for, good start
<abu[7]> ☺
<geri> thanks!
<abu[7]> np
<geri> also i just realized you wrote like entirety of pil21 in termux
<geri> thats still very much insane
<abu[7]> T
<abu[7]> This irc here too
<abu[7]> My problem is that I have trouble with my right hand
<abu[7]> so I can't use Penti well
<abu[7]> I wrote a new keyboard
<geri> like you wrote an IRC client?
<abu[7]> but I'm not used to it yet
<geri> aw
<geri> use your left one! :D
<abu[7]> Yes, but what I mean here is that I type on my phone right now
<abu[7]> ... very slow now ...
<abu[7]> Left one is also still slow
<abu[7]> My new keyboard needs only one finger :)
<geri> xd
<abu[7]> BTW, my irc client is https://software-lab.de/irc.tgz
<abu[7]> It is a daemon and one client per channel
<abu[7]> It runs on picolisp.com and I'm connected via ssh
<geri> only like 300 lines
<geri> very cool
<geri> what's up with your right hand?
<abu[7]> Morbus Dupuytren
<abu[7]> Only the little finger
<geri> :(
<abu[7]> Maybe too much typing with Penti over the years
<geri> who knows
<abu[7]> T
<geri> still a good idea to learn typing with your left hand though
<abu[7]> Yes
<abu[7]> I still *can* use Penti
tankf33der has joined #picolisp
<tankf33der> hi all
<abu[7]> (just now I swiched back to type faster)
<tankf33der> abu[7]: here?
<abu[7]> Hi tankf33der!
<tankf33der> small question: (call 'rm '-rf "mike-*") do not delete files.
<abu[7]> Yes
<geri> you probably need to call sh instead
<abu[7]> Patters expansion is done by the shell
<geri> (call 'sh '-c "rm -rf mile-*")
<geri> that
<abu[7]> T
<tankf33der> damn, of course.
<geri> s/mile/mike
<abu[7]> or (for F (dir) (and (pre? "mike-" F) (%@ "unlink" 'I F)))
<abu[7]> not tested
<abu[7]> But not recursive like "rm -rf"
<geri> there was another C function for removing directories
<abu[7]> (for F (dir) (and (pre? "mike-" F) (call "rm" "-rf
<abu[7]> grb
<abu[7]> grr
<abu[7]> (for F (dir) (and (pre? "mike-" F) (call "rm" "-rf" F]
<geri> also if that works its gonna be like infinitely faster than using call
<geri> ahahaha
<geri> nice use of superparen
<geri> aw, %@ mkdir cant do recursive delete
<geri> s/mk/rm/
<abu[7]> really? Didn't try
<abu[7]> Right. It must be even empty
<abu[7]> excebt for . and ..
<abu[7]> Actually I knew this, but forgot about it :)
<abu[7]> Same as the 'rmdir' command
<abu[7]> OK, must stop, family duties ;)
<geri> have fun
<geri> ill be going too
<abu[7]> OK :)
<abu[7]> cu
geri has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.3)]
tankf33der has quit [Quit: leaving]
alexshendi has quit [Read error: Connection reset by peer]
alexshendi has joined #picolisp