pablo_escoberg63 has quit [Ping timeout: 246 seconds]
<aw->
pablo_escoberg: replacing substrings with chop/pack/split is precisely why you're coding in Lisp and not Perl
<aw->
combining functions to obtain the exact data/results you want, that's the heart of every lisp language. much less tedious than writing an obscure regex that you'll NEVER figure out a couple years later when you re-visit your code
pablo_escoberg has quit [Ping timeout: 246 seconds]
m_mans has quit [Remote host closed the connection]
seninha has joined #picolisp
pablo_escoberg has joined #picolisp
<pablo_escoberg>
OK, cool. I'll play with it and see what I come up with. Thanks for the guidance
<pablo_escoberg>
(so far, I'm finding this a lot more verbose than regexps, but I'll reserve judgement on later readability. I've spent many hours wrangling regexps and can read them like a second language, so I'm biased and will take the time to try to become unbiased. If I still hate it (and, ceteris paribus, I strongly favor conciseness so I may) I'll find a
<pablo_escoberg>
different solution)
<abu[m]>
skyjuice: I'm not sure what you mean. ":map" sets the global 'vip~*KeyMap' which will then fire when the defined keys are typed
<abu[m]>
pablo_escoberg: As aw- says, regexes are not used in Pil. There is a rosetta task though with an example using a C-lib
<abu[m]>
Can you give an example of what you want to do?
<pablo_escoberg>
Sure. And I think I found an alternative way of doing it.
<abu[m]>
great!
<pablo_escoberg>
Yeah, let me make sure, but I think I won't need it. Great to know they're there if I need them, though, even if it means resorting to a C lib.
<abu[m]>
Good. And, as ever, don't abstract or optimize prematurely! You tend to look for solutions before there is even a problem ;)
<pablo_escoberg>
LOL. If I had a nickel for every time somebody told me that (the abstraction part, never optimization).... well, actually, I have many nickels for every time somebody told me that, thankfully :). IAC, looks like I can build what I need using "fill", so yay!
<abu[m]>
☺
<abu[m]>
Sometimes I have the same problem. Building abstractions is fun!
<abu[m]>
But it should not be too early
<pablo_escoberg>
Well, of course it shouldn't be too early. That's what "too early" means :D
<abu[m]>
The problem is to know when it is too early. Sometimes it may be too late.
<pablo_escoberg>
exactly! To me, that's what technical debt comes down to: fear of abstraction, but that's just me.
<pablo_escoberg>
And relatedly, poor naming policies. That's another killer.
<abu[m]>
Right. Once a name is established, it is difficult to get rid of it
<pablo_escoberg>
Yes, and names and abstractions guide each other, at least the way I think of it ("what is this thing? Aha! Ok, I'll call it that and abstract it away").
pablo_escoberg has quit [Quit: Client closed]
pablo_escoberg has joined #picolisp
seninha has quit [Quit: Leaving]
seninha has joined #picolisp
seninha has quit [Quit: Leaving]
seninha has joined #picolisp
<aw->
abu[m]: hi
<aw->
perhaps a stupid question, but i have PilBox 18.2.10 on my phone, should I update to the latest? am i missing much?
<abu[m]>
Better to update. PilBox changed a lot (last release was today)
<abu[m]>
Did you disable automatic updates from PlayStore? (or direct APK install?)
<abu[m]>
But scanQR had been there all the time. An example use is in "demo.zip".
<abu[m]>
demo changed too today. Removed the deprecated (zxing?) call
<aw->
oh i see
<abu[m]>
I *really* would like to put PilBox (and also PentiKeyboard) to F-Droid. But I don't understand how to do it.
<abu[m]>
Mia is bette with such things, but she failed too
<abu[m]>
*better
<abu[m]>
We asked F-Droid for support, but no answer
<skyjuice>
<abu[m]> "skyjuice: I'm not sure what..." <- Never mind, I just realized "SPC" is already in use as the de facto command window prefix key so my desired "SPC + x" remaps wouldn't work
<abu[m]>
Yeah, space is the same as colon, putting focus into the command window
<abu[m]>
(easier to type than colon, especially on Penti)
<abu[m]>
Which key -> command would you need most?
<skyjuice>
<abu[m]> "Which key -> command would you..." <- :w write file to buffer
<skyjuice>
*write buffer to file
<abu[m]>
How about using a function key?
<skyjuice>
sure, that would work
<abu[m]>
If I recorded it correctly, the keys which are still free in Vip are:
<abu[m]>
( ) @ F H L T U V Y ^G ^H ^K ^L ^N ^O ^P ^U ^V ^Y [ ] ^ _
<abu[m]>
So you could map one of these
<abu[m]>
I usually use @ when I need a quick mapping
<abu[m]>
And, in Penti, you have of course also all the Alt-Keys
<abu[m]>
ĥíñĉ§ etc.
<abu[m]>
Not only in Vip. In bash for example I use ± to clear the history
<abu[m]>
You probably know that in Penti you can redefine all Alt-Keys with Func-D
<skyjuice>
thx, are there sample viprc's documented anywhere?
<abu[m]>
Yes, in the Pil distro in @doc/viprc.sample
<skyjuice>
<abu[m]> "I *really* would like to put..." <- Have you looked into Izzyondroid (fdroid style repo & client), I've heard its easier than fdroid WRT to publishing apps.
<abu[m]>
Cool! Did not know. I will investigate that, thanks!
seninha has quit [Quit: Leaving]
seninha has joined #picolisp
m_mans has joined #picolisp
m_mans has quit [Ping timeout: 246 seconds]
<pablo_escoberg>
Another newbie question: What is the difference between (get This 'x) and (: 'x)? I expected them to be identical, but it seems there are times when the former works and the latter doesn't and I can't figure out what the commonality is.
<abu[m]>
Note that (: 'x) is wrong. ':' does not evaluate the arguments
<abu[m]>
Otherwise they are equivalent
<pablo_escoberg>
right, should have said (: x). Still getting used to it.
<pablo_escoberg>
ah, ok, guess that's probably what happened. TY.
<abu[m]>
Then it should give the same result as (get This 'x)
<abu[m]>
good :)
drakonis has quit [Server closed connection]
drakonis has joined #picolisp
pablo_escoberg has quit [Quit: Client closed]
pablo_escoberg has joined #picolisp
<pablo_escoberg>
So I'm calling the following: (call (fill '(echo " \"" .output " " @from_proc "^J.read" " " @to_proc "\"" "|" sqlite3 &))) and getting a "Can't exec" error. I've cut and pasted the filled command into the command line and it works, so I assume it's complaining about spaces in the list to be called. Is there an easy workaround?
<pablo_escoberg>
NVM, I think I can figure it out. If not, I'll ask again. TY anyway.
<abu[m]>
ok :)
<abu[m]>
Hint: (call "echo" "arg1" "arg2")
<abu[m]>
NOT a list
<pablo_escoberg>
yup, got that part. Now I am stuck again. (call 'echo "\".output" "/home/evronm/.pil/tmp/176225/out59283052116470" "^J.read" "/home/evronm/.pil/tmp/176225/in59283052116470" "\"" "|" 'sqlite3 '&) . For some reason, "echo" does not go through.
<pablo_escoberg>
It's like the thing is determined to prevent me from sending a command with arguments...
<abu[m]>
Think about what the args to "echo" are supposed to be. What is "\".output" "/... ?
<abu[m]>
Why not simply (call "echo" ".output" ... ?
<abu[m]>
I mean, why the double quotes as part of the argument?
<abu[m]>
And: You can't pass "&" to echo
<abu[m]>
"&" is SHELL syntax
pablo_escoberg71 has joined #picolisp
<abu[m]>
Same with "|" etc.
<pablo_escoberg71>
These are commands to be piped to sqlite3
<abu[m]>
Perhaps you want (call "sh" "-c" "foo | blub &") or so?
<pablo_escoberg71>
thing is, if I replace "call" with "pack" and copy/paste, it works.
pablo_escoberg has quit [Quit: Client closed]
<abu[m]>
You will find it out :)
<pablo_escoberg71>
oh, wait, it doesn't! It did...
<pablo_escoberg71>
OK, I'll keep playing, and try the shell -c thing
<abu[m]>
How would you do that on a shell command line?
<abu[m]>
Then just do the same in pil ;)
<pablo_escoberg71>
thing is, it stips off the first command. I can't figure out why.
<pablo_escoberg71>
so when I do (call 'echo "\".output" "/home/evronm/.pil/tmp/176225/out59283052116470" "^J.read" "/home/evronm/.pil/tmp/176225/in59283052116470" "\"" "|" 'sqlite3 '&) the "echo" does not appear in the output.
<pablo_escoberg71>
I guess a different way of asking the question: why doesn't the above work as well?
<pablo_escoberg71>
I'll do it the other way, but I'd like to know why this doesn't work if possible.
<abu[m]>
I don't know what you expect. But echo echoes and is of course not echoed by itself
<abu[m]>
echo ".output ..." | sqlite3
<abu[m]>
right?
<abu[m]>
So "echo" is not sent to the pipe
<abu[m]>
and in pil the same is (out '("sqlite2") (prinl ".output ..."))
<pablo_escoberg71>
Right, but neither is anything else...
<abu[m]>
Sorry, I give up
<pablo_escoberg71>
OK, cool. I'll just do it the other way and see if I can figure this out in the process.
<pablo_escoberg71>
Thanks for all the help.
<abu[m]>
Seems I was not helpful
<abu[m]>
Let's talk next time. Good night :)
<pablo_escoberg71>
You certainly were. I still don't understand this one thing. But at least I have a workaround, and said workaround may help me figure out the thing I don't understand.