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
aw- has joined #picolisp
clacke has joined #picolisp
Hunar has joined #picolisp
<Hunar> Good morning Regenaxer :)   I'm still not very comfortable with having no macros in pil,  how can I approach this in pil    I have two functions   a   and   z   which must run before and after my multi-line codes respectively.. how can I make function (ab) that replaces       (a) (my-code) (my-other-code)... (b)      with
<Hunar> (ab (my-code) (my-other-code)...)     I read https://picolisp.com/wiki/?macros but that page doesn't give actual examples, only the syntax so I didn't get that far
<Regenaxer> Good morning Hunar
<Regenaxer> This Wiki article is very good. In fact I did not know it.
<Regenaxer> But it does not mention the more typical solution in PicoLisp, FEXPRs
<Regenaxer> As the article says, macros don't play the same role as in compiled langs
<Regenaxer> Read-macros are used everywhere, but for different purposes
<Regenaxer> What you want is (de f Prg (a) (run Prg) (b))
<Regenaxer> Recommended is to do before that: (private) Prg
<Hunar> why should I (private) it?
<Regenaxer> I made a long PilCon abuut that ;)
<Regenaxer> Symbol bindings may conflict
<Regenaxer> See faq.html
<Hunar> So it makes sure that after I use the function f the symbol Prg is still unused?
<Regenaxer> No, it concerns *other* cases of 'Prg'
<Regenaxer> Read the faq about problems of dynamic bindings
<Regenaxer> I think in your case you don't need the (private)
<Regenaxer> it is more a general recommendation
<Regenaxer> See libraries like @lib/xhtml.l
<Regenaxer> making heavy use of FEXPRs
<Hunar> Ah, that's good to know :)
<Regenaxer> or @lib/svg.l
<Hunar> one tiny question, that time you mentioned (infix) library, do you have a link? I couldn't google it
<Regenaxer> If you don't use nested FEXPRs for example, you don't need to care
<Regenaxer> Really? I don't remember
<Regenaxer> I RosettaCode perhaps
<Hunar> I'll use nested FEXPRs in the future
<Regenaxer> Hmm, which *library*?
<Regenaxer> There was a rosetta task iirc
<Regenaxer> "Parsing/RPN to infix conversion"
<Regenaxer> not sure
<Hunar> I found that but it outputs infix notation, but you example was this   '(infix '(1+3*(4-5)))  which takes infix notation
<Regenaxer> It is quite easy to write a recursive infix parser
<Regenaxer> What do you need it for?
<Hunar> Nothing currently :)  I thought it was already made
<Regenaxer> I had this in some project for user interface, but it is not usable stand-alone
<Regenaxer> If it is not jcst infix, but arbitrary expression strings, you start with 'read'
<Regenaxer> like (read "_" "#")
<Regenaxer> to tokenize the string
<Regenaxer> then you simply recurse on it
<Hunar> It sounds like a problem for me in the future :)  thanks
<Regenaxer> There seems an article in the Wiki
<Regenaxer> yes
<Regenaxer> Such code highly depends on the use case
<Regenaxer> the format that needs to be parsed
<Hunar> How did i supposed to find a page called P93 :/  what does P93 mean
<Hunar> thanks for the link :)
<Regenaxer> P93 is one in a series of tasks
<Hunar> Ah, it's in the book
<Regenaxer> 99 tasks iirc
<Regenaxer> which book?
<Regenaxer> I think it was a list of Prolog tasks originally
<Regenaxer> ah, right
<Regenaxer> this is a bit old though
<Regenaxer> probably a lot outdated
<Regenaxer> pil changed meanwhile
<Hunar> It was very useful for me at the beginning :)
<Regenaxer> The books reflect the Wiki at that time
<Regenaxer> plus reference and rosettacode
<Regenaxer> So it is easier to search directly in the Wiki
<Hunar> It had one major issue
<Hunar> the book i mean
<Hunar> If you copied any code from the pdf with    '     in it, it wouldn't work because it was turned into `
<Regenaxer> hehe
<Regenaxer> As I say, just use the Wiki
<Regenaxer> I use it in w3m
<Regenaxer> just text, easy to copy/paste etc
<Hunar> Yep :)
<Hunar> I have an unrelated topic   :)      Have you seen this project before    https://github.com/rui314/minilisp    for some reason when I first discovered picolisp it felt like picolisp and minilisp were made by the same person, the syntax and simplicity were very similar in my eyes
<Regenaxer> ok, but sorry I can't concentrate on reading that now
<Regenaxer> lots of things to do here
<Regenaxer> I can answer short questions but not a complicated discussion
<Hunar> No problem, just wanted to know if by chance it was related to you :)
<Hunar> sorry
<Regenaxer> No problem! :)
<Regenaxer> No, not related
rob_w has joined #picolisp
<aw-> Hunar: regarding macros, what I do is generate my own .l files in a tmp directory, and then (load) them as needed
<Regenaxer> Hi aw-!
<aw-> hi Regenaxer
<Regenaxer> :)
<aw-> but it's so rare to "need" that functionality, the whole purpose of a macro is to expand code so it appears in multiple locations, as opposed to making function calls
<aw-> that concept doesnt make sense in a picolisp interpreter
<Hunar> aw- that is a good way of doing it :)  My biggest need for macros is just the old copy/paste of code, I don't want all the functionality of a macro
<Regenaxer> yes, what you mean are FEXPs in PicoLisp
<Regenaxer> passing code to other code
<Regenaxer> Why bother modifying code with macros at runtime, when you can do such things *directly*?
<Hunar> Just to simplify syntax :)  that's my only use case
<Regenaxer> yep
<Hunar> Can you redo your solution    (de f Prg (a) (run Prg) (b))   with FEXPs? my goal is to know if I need to (eval) or (run) the result of calling f :(  I don't want to do that
<Regenaxer> That *is* a FEXPR
<Hunar> Ah, I realized my error after sending it
<Regenaxer> np :)
beneroth has joined #picolisp
razzy has quit [Quit: leaving]
Hunar has quit [Quit: Client closed]
aw- has quit [Ping timeout: 245 seconds]
rob_w has quit [Remote host closed the connection]
razzy has joined #picolisp
<razzy> good day to all.
<Regenaxer> Di razzy!
<beneroth> Ahoy razzy, Regenaxer :)
<razzy> after long struggle i have ESC mapped to CAPS position. finally
<Regenaxer> Hi beneroth!
<Regenaxer> cool razzy!
<beneroth> congrats :)
<razzy> jokes aside, it is not so easy on pinephone :]
<Regenaxer> ah, yeah
<beneroth> why not?
<beneroth> honest question
<beneroth> also measured in which way: compared to other Linux computers? compared to Android? compared to iPhone?
<razzy> beneroth: I was not expecting different X server. Debian on pinephone uses Wayland
<beneroth> ah I see
<razzy> compared to my desktop debian
<Regenaxer> So no .Xmodmap
<beneroth> yeah well you can not expect old proven tech to stay around
<razzy> nope
<beneroth> old buggy tech is ok, we keep that
<Regenaxer> Is it possible to install something like Penti?
<Regenaxer> Back then I investigated Ubuntu Touch
<Regenaxer> and it seemed not possible
<beneroth> (granted X appears to have some inefficiencies and security issues, but then a replacement should have feature parity...)
<razzy> :D buggy tech need maintenance, right kind of buggy tech brings food on the table.
<beneroth> I would like to have progress to the point the table gets the food itself
<beneroth> but probably we live in the best food times right now and it only will get worse :/
<beneroth> Regenaxer, you tried porting android penti or starting with your linux module?
<razzy> Regenaxer: i am using mobian. if penti works on desktop-ARM, i think it will work on mobian.
<razzy> android penti could have problems
<razzy> beneroth: they say wayland is immature and fetures will come in future.
<beneroth> so then you use wrong distro :P
<razzy> T
<Regenaxer> beneroth, I did not port yet. Only investigated whether it is *possible* to have a user-space touch keyboard. I even asked the Ubuntu team, but could not find a way
<Regenaxer> Penti is 100% Java
<Regenaxer> and 100% depends on Android ;)
<Regenaxer> Could be ported though
<Regenaxer> The question is if/how Wayland allows user-land keyboards
<Regenaxer> (I don't want to hack kernel drivers again)
<beneroth> yeah I see
<razzy> wayland is keyboard immature. i edited /usr/share/X11/xkb/keycodes/evdev
<Regenaxer> In Android it is extremely easy, just write an InputMethodService
<Regenaxer> yeah, evdev
<Regenaxer> I edited it on X11 too back then
<Regenaxer> (beneroth remembers)
<beneroth> T
<razzy> hmm, what is weird undeletable underline _ after deleted characters? it is in middle of file
<razzy> vip
<beneroth> razzy, maybe a tab or other pending whitespace?
<razzy> maybe.
<razzy> i have file http://ix.io/3Gvi/text in ~/.pil/viprc . i want to switch up and down j,k. it does not seem to work.
<beneroth> no idea, sorry I'm not (yet) using vip and not a vi guru. do arrow keys work? maybe you are in a command mode?
<razzy> beneroth: not worry :] i am waiting for Regenaxer
<Regenaxer> "undeletable underline" marks a space at thend of a line
<Regenaxer> Find it with / $
beneroth_ has joined #picolisp
<Regenaxer> The *KeyMap should be fine (?)
beneroth has quit [Ping timeout: 256 seconds]
<Regenaxer> So beneroth was right: "..or other pending whitespace"
<Regenaxer> ah, *KeyMap does not work this way
<Regenaxer> Vip uses 'assoc' to search through it
<razzy> in my oppinion i copyied it from picolisp maillist
<Regenaxer> you can do
<Regenaxer> (de *KeyMap
<Regenaxer> ("j" (move 'goUp *Cnt)) # [UP] Move up
<Regenaxer> ("k" (move 'goDown *Cnt))
<Regenaxer> )
<razzy> why not double ("j" "B") ?
<razzy> ok, because machinery :D
<Regenaxer> Was this really in the mailing list?
<Regenaxer> yes
<Regenaxer> 'case' accepts lists of values
<Regenaxer> but not assoc
<razzy> mailing list was simple values
<Regenaxer> ok
<razzy> i see, thank you
<Regenaxer> this is indeed a limitation
<Regenaxer> But let's keep it simple ;)
<Regenaxer> and trailing blank you can simply delete
<Regenaxer> with 'x'
<Regenaxer> I mark it up in the text, cause I think it is bad style to have useless trailing blanks
<razzy> :D T
<Regenaxer> They also disappear if you switch off markup
<Regenaxer> with F1
<razzy> I got my F1-12 back. i am happy :]
<Regenaxer> great :)
clacke has quit [Remote host closed the connection]
beneroth_ has quit [*.net *.split]
inara` has quit [*.net *.split]
mario-goulart has quit [*.net *.split]
stux|away has quit [*.net *.split]
f8l has quit [*.net *.split]
razzy has quit [Ping timeout: 256 seconds]
razzy has joined #picolisp
beneroth_ has joined #picolisp
inara` has joined #picolisp
mario-goulart has joined #picolisp
f8l has joined #picolisp
stux|away has joined #picolisp
beneroth_ has quit [Quit: Leaving]
<Regenaxer> razzy: I also added *CmdMap now
<Regenaxer> 'command's can be extended
<Regenaxer> Just for completensess, I think I don't need it
<Regenaxer> afp
aw- has joined #picolisp