alexshendi has quit [Read error: Connection reset by peer]
aw- has joined #picolisp
aw- has quit [Client Quit]
linus` has joined #picolisp
linus`__ has quit [Read error: Connection reset by peer]
aw- has joined #picolisp
rob_w has joined #picolisp
<beneroth>
Regenaxer, did you ever do android contact synchronisation using pilBox?
<Regenaxer>
The Android Contacts App data?
<Regenaxer>
In any case, not. I don't synchronize anything with any outside cloud
<Regenaxer>
I export the contact data into a "contacts.vcf" file in Termux
<Regenaxer>
Then replicate the whole Termux environment
<Regenaxer>
My mail client is 'mutt' in Termux, so no PGP/GPG problems :)
<Regenaxer>
No HTML mails
mtsd has joined #picolisp
<beneroth>
I mean for client systems, not necessarily your personal use
<beneroth>
A conctacts.vcf download might be good enough, though it's then not synchronising afaik.
<Regenaxer>
Yep
<Regenaxer>
I never did anything with contacts progammatically
<beneroth>
ok
<Regenaxer>
What kind of application do you think of?
<beneroth>
CRM
<Regenaxer>
yes, but what Android app?
<Regenaxer>
What should the app do?
<beneroth>
synchronise the contacts in the CRM (pil web app) with the android contacts. not touching the other contacts on the phone.
<beneroth>
just an idea. no definitive requirement yet.
<Regenaxer>
A contact DB in PilBox?
<beneroth>
would maybe be a better option (surely from security/surveillance angle)
<beneroth>
another option would maybe be an interface (webdav?) on the server, instead of using a pilBox app. that would probably then also allow compatibility to iPhones etc.
<beneroth>
these are the options, right?
<Regenaxer>
I don't really understand the purpose
<Regenaxer>
hmm, ok
<Regenaxer>
I see
<Regenaxer>
synchronise the contacts in the CRM
<beneroth>
1. Have a business contact with phone number on pil web app 2. copy/synchronise this data somehow on the phone 3. call the guy
<beneroth>
4. change some contact data on the phone 5. communicate that change to the pil web app
<beneroth>
aye
<Regenaxer>
I never thought much about the contacts in Android, as I use them only for WhatsApp
<beneroth>
problem of most synchronisation software afaik is, that in facts one contact in android are technically stored as multiple contacts (and displayed as 1 in android), e.g. WhatsApp contact, other messenger contact, phone contact, phone contact stored on SIM card
<Regenaxer>
yeah
<beneroth>
in the business environment there will be existing contact data lying around in many different formats in many different software, which probably should be imported into any new central CRM
<beneroth>
and surely there are also some employees which just want work with their iPhones, old windows phones, what not
<beneroth>
ok, thanks :)
<Regenaxer>
Hmm, I have no real idea ;)
<beneroth>
so you agree, it should be possible to connect to this android contact interface via pilBox, or using a server interface this mainstream contact software supports. though better might be a dedicated pilBox app, so the data is not leaked and separated from prviate contacts on the phone etc.
<beneroth>
but we don't have any experience on this topic around yet
<Regenaxer>
yes, should surely be possible
<Regenaxer>
We would need to look up the Android Contacts toolbox and call it
<aw->
i switched to Alpine just last week, i think Nistur is on emacs/gnus ?
<Regenaxer>
I have to hit M to view them in external browser if absolutely necessary
<Regenaxer>
Most of all I hate mails which are HTML-*only*
<aw->
yeah just delete them haha
<Nistur>
aw-: yes
<Nistur>
also
<Nistur>
hello
<Nistur>
I'm still here, still alive :P
<beneroth>
hey aw-, Nistur :D
<Regenaxer>
Hi Nistur!
<Nistur>
I haven't forgotten about you lot, just been too busy to do anything fun :'(
<beneroth>
btw. HTML injection is also the basic issue with the recent fuss about S/MIME and PGP insecurity
<Nistur>
I saw thatt
<Nistur>
some of the reporting was fear mongering
<Nistur>
suggesting that PGP was broken
<beneroth>
yeah
<beneroth>
well email security is completely flawed anyway
<Regenaxer>
and main stream media don't understand at all what they write
<beneroth>
(header data is never encrypted. including subject. metadata is enough for USA to kill people)
<Regenaxer>
T
<Regenaxer>
We must use Briar instant messenger
<beneroth>
haven't looked at it yet. how does it solve the scaling problem?
<Regenaxer>
It uses Tor
<beneroth>
ah right
<beneroth>
ah right I did look at it and mention it here haha
<Regenaxer>
better than nothing
<aw->
beneroth: yes i was referring to the PGP thing actually
<beneroth>
aw-, alright :)
<beneroth>
Regenaxer, right, I think I actually was the first who mentioned briar here. I forget to easy xD
<beneroth>
(passwords are secure with me)
<aw->
theres Orbot for Android
<aw->
can put anything over Tor
<beneroth>
well, how much can we trust Android
<beneroth>
but yeah, better than not having Orbot :)
<aw->
beneroth: LineageOS here
<Regenaxer>
We should get PilOS running on mobile devices
<aw->
actually it's funny, my phone has the exact same CPU as my desktop computer
<aw->
welcome to 2018
<beneroth>
they will still get you with silent SMS, the baseband will answer without asking the OS for permission :(
<beneroth>
aw-, :D
<aw->
beneroth: no SIM card
<beneroth>
than its no phone
<aw->
also removed all cell/baseband apps
<Regenaxer>
same here, my SIM card is in a 15-year old phone
<aw->
what is a phone?
<aw->
a device used to make phone calls
<beneroth>
T
<aw->
name me one person who makes phone calls with their "smartphone"
<beneroth>
me
<beneroth>
(haven't replaced with feature phone yet)
<aw->
Regenaxer: same.. SIM in my 2011 galakei
<Regenaxer>
:)
<aw->
beneroth: i like the idea of not having a SIM in my "phone", batt lasts 4 days on one charge
<Regenaxer>
I use mine since 2002
<beneroth>
I find 4 days is not much, when I remember my old nokia feature phone 10 years ago.
<Regenaxer>
second battery still
<beneroth>
we get used to sinking standards pretty quickly, too :(
<beneroth>
I still have my first battery in my 2011 phone
<aw->
indeed
<aw->
i gotta run
<aw->
bbl
<beneroth>
see ya!
<beneroth>
have a good run!
<Regenaxer>
cu!
aw- has quit [Quit: Leaving.]
<beneroth>
Regenaxer, (apply onOff (list Var)) vs. (set Var (not (val Var)))
<Regenaxer>
onOff does not evaluate the args, so it won't work this way
<Regenaxer>
(onOff (NIL)) should be fine
<Regenaxer>
eg as (de f () (onOff (NIL)))
<Regenaxer>
Self-modifying function
<Regenaxer>
For example, see in @lib/form.l
<Regenaxer>
(de alternating ()
<Regenaxer>
(onOff "rowF") )
<beneroth>
nah its not about self-modifying, but about having a Var instead of Symbol. Quoted vs Evaluated
<beneroth>
I went with (set Var (not (val Var)))
<Regenaxer>
right
<Regenaxer>
But why not (onOff Var) then? Why complicated with 'apply'?
<Regenaxer>
(for the records: 'apply' is not applicable here as it works only withe evaluating functions)
<beneroth>
(de foo (Var) (onOff Var)) (foo 'Bar) -> doesn't work
<beneroth>
I wont to pass an unevaluated argument to onOff
<Regenaxer>
exactly
<beneroth>
a/wont/want
<beneroth>
s/a/s
<beneroth>
argh
<Regenaxer>
onOff is for direct usage
<beneroth>
yeah. how to do indirect usage, beside (set Var (not (val Var))) ?
<Regenaxer>
Here (set ..) is the best (only?) way
<beneroth>
ok :)
<beneroth>
that was the question :)
<Regenaxer>
Good :)
<beneroth>
thanks for the review :) sorry for the bad wording
<Regenaxer>
No problem. It is fair to expect an evaluating function here
<Regenaxer>
we have (set 'X) <-> (off X) and (set 'X T) <-> (off X)
<beneroth>
use case is a function which takes a flag variable and does multiple checks (looks at settings) if its toggled or not.
<beneroth>
rather rare use case :)
<beneroth>
aye!
<Regenaxer>
oops, I mean (set 'X T) <-> (on X)
<Regenaxer>
but you knew
<beneroth>
yeah :)
<beneroth>
Regenaxer, mapping functions: when a local function is to be used within the anonymous function in a map (e.g. filter, mapcar, etc), it's better to declare the local function outside the mapping, I guess? like (let foo '(() ...) (filter '(() ... (foo) ... ) List) instead of (filter '(() (let foo '(() ...) ... (foo) ...)) List) ?
<Regenaxer>
Not at all, it would be just overhead
<Regenaxer>
anonymous inline is fine
<beneroth>
hm. right. on second thought, I can see that it doesn't make any difference.
<Regenaxer>
hmm
<Regenaxer>
Why the 'let' at all? Did I misunderstand?
<Regenaxer>
you need (foo) repeatedly?
<beneroth>
only within the mapped function
<Regenaxer>
Then a global function is better
<beneroth>
but multiple times within the mapped function
<Regenaxer>
yes, but 'let' in each iteration takes a little
<Regenaxer>
yeah
<Regenaxer>
Not a big difference
<beneroth>
so a let outside of the iteration would be better? that is the question ^^
<Regenaxer>
yes
<Regenaxer>
I thought no 'let' at all
<Regenaxer>
just (de foo ... globally
<Regenaxer>
but this depends
<beneroth>
yeah the function is not needed anywhere else, so I don't want to intern it globally
<Regenaxer>
Then you can make it local as (de "foo" ...
<Regenaxer>
A let makes sense if the function changes all the time
<Regenaxer>
Like 'gui' in 'form'
<beneroth>
T
<beneroth>
that is another use case
<Regenaxer>
there we have (let gui ...
<Regenaxer>
yeah
<beneroth>
well here it is for a function used multiple times within the iteration, but nowhere else. a transient symbol would still be scoped globally, just not reachable, no?
<Regenaxer>
The convention for globally visible but locally intended functions is (de _foo ..
<Regenaxer>
Yes, so not *scoped* at all
<beneroth>
my point is kinda I want it not to occupy cells when I don't use it anymore :)
<Regenaxer>
Scope means "visibility"
<beneroth>
hm. T. ok, what's the term for "not garbage collected" ? :D
<beneroth>
ok.. so.. a transient symbol is still persistent, right?
<Regenaxer>
Only as long as all references from code exist
<Regenaxer>
not from the symbol itself as in 'foo'
<Regenaxer>
as 'foo' in interned and thus persistent
<beneroth>
a (let) is not persistent when leaving the (let), though additional (cells) overhead might occur because the previous definition is backed up
<Regenaxer>
"persistent" is not good, I use it for DB symbols ...
<beneroth>
T
<Regenaxer>
not because of back up
<Regenaxer>
(let foo '(()) takes 5 cells
<Regenaxer>
well, the 'let' takes 2 cells
<Regenaxer>
'foo' takes also 2
<Regenaxer>
one for the symbol and one in the namespace
<beneroth>
well ok, but without the (let) there must be a (de) or (setq) or such, so I guess it doesn't make a difference really?
<Regenaxer>
or 2 in the namespace if not a leaf node
<Regenaxer>
average 1.5 cells
<Regenaxer>
no
<Regenaxer>
(let foo '(() )
<Regenaxer>
ah
<Regenaxer>
here 'foo' is also interned btw
<beneroth>
T
<Regenaxer>
So it always takes 2 cells more for the let
<beneroth>
I mean (let foo '(())) vs. (de "_foo" ())
<Regenaxer>
The (let foo remains in the code
<beneroth>
T
<Regenaxer>
the de expression is gone
<beneroth>
though in my case it's a one-shot scripts anyway ^^
<Regenaxer>
hehe, we are trying to save each cell! Good attitude! :)
<Regenaxer>
ah, ok
<Regenaxer>
then the code is gone anyway
<beneroth>
yep! a bit over the point, but good to be aware of what really happens
<Regenaxer>
Then the 'let' outside the mapping is fine
<beneroth>
aye! then (let) vs. (de "foo") is not much difference, is it?
<Regenaxer>
right
<Regenaxer>
(let foo interns the symbol
<Regenaxer>
(let "foo" would not
<Regenaxer>
but then (de "foo" ..) is faster
<beneroth>
(de "foo") is better for code which should only be visible locally, but belongs to a piece which might be executed multiple times during the lifetime of its process
<beneroth>
ah
<beneroth>
so on my pretty edge case, (let) would probably save few cells, but (de) would run faster? ha!
<Regenaxer>
Even better (though slower) is probably a little namespace
<Regenaxer>
I think saving cells is not the big issue anyway, as iit is a once-through code
<beneroth>
as it's a one-shot script and memory not the problem, I should better optimize for speed than space in this particular special case
<beneroth>
T
<beneroth>
so (de "foo") then :D
<Regenaxer>
For speed definitely (de "foo" is best
<Regenaxer>
yes
* beneroth
learned some more. the discussion was worth it :)
<Regenaxer>
yes, interesting
<beneroth>
I just find it great that with picolisp we can actually have such discussions. in most stacks this would be completely pointless, as to many variables interfere to be able to say anything accurate at all
<beneroth>
not that it does matter much here, this was an academic thing, but still ...
<Regenaxer>
yeah, indeed
<sriram>
In trying to understand pdfPage, I saw code like (<layout> (csslist) (div @ (pdfPage ..)) (div @ (pdfCanvas ...)))
<sriram>
so <layout> was creating the page with two divs.
<Regenaxer>
Unfortunately <layout> is not documented
<sriram>
since I dont need the panel I was trying to remove the second div, but it did not work
<sriram>
so it became clear I need to understand <layout>
<Regenaxer>
The idea is that it arranges divs either right or below the current one
<sriram>
but first, I was wondering what the @ in div @ ....means
<Regenaxer>
It passes css styles bound in '@'
<Regenaxer>
most notably position info
<sriram>
(ah I was wondering if the stacking was achieved by css or by <layout>)
<Regenaxer>
it is on-the-fly css
<sriram>
(where do the css styles get bound to @, which function?)
<sriram>
maybe <layout> does it?
<Regenaxer>
it happens in (prog1
<Regenaxer>
yes
<Regenaxer>
(prog1 (if ...) (eval))
<sriram>
ah yes...i see the comment @ --> '@'
<Regenaxer>
There is a comment # -> '@'
<Regenaxer>
yess :)
<sriram>
i mean # -> '@'
<sriram>
ok good...so I just need to understand <layout> then, it seems :)
<Regenaxer>
<layout> code is rather involved
<Regenaxer>
I would recommend to look at examples
<Regenaxer>
and experiment with it
<Regenaxer>
I do so too usually
<sriram>
ok..sure...I was looking at it more from a code reading experiment because it uses recur and recurse, but will do as you
<sriram>
suggest
<Regenaxer>
first of all, if you call it as
<Regenaxer>
(<layout> T
<Regenaxer>
then all coordinates are in percentages
<Regenaxer>
Just
<Regenaxer>
(<layout>
<Regenaxer>
is in pixels
<sriram>
(one question though...doesnt the binding of @ inside <layout> affect any if statements inside it?
<Regenaxer>
I think it is OK
<sriram>
(ah thats what was puzzling me : (let P (and (=T (car "Lst")) (++ "Lst")))
<Regenaxer>
yeah, exactly
<Regenaxer>
it checks for the T
<sriram>
(i knew P would be bound to T if that succeeded but did not see wht car of "Lst" would be T
<Regenaxer>
As I said, the code is quite hard stuff
<beneroth>
incomplete js implementation of picolisp :)
<beneroth>
hmm
<beneroth>
Regenaxer, what's your opinion on the trend that browser replaces OS ? I would guess you are more likely an opponent, but arguably your way of working profited a lot from it :)
<Regenaxer>
both yes
<Regenaxer>
I find browsers too complex to rely on them
<beneroth>
My personal opinion is currently that it's adding turtles, another layer trying to emulate things we have another, much better tested layer for already
<beneroth>
yeah, this
<Regenaxer>
But to give software to users they are the easiest
<beneroth>
also easiest to give them malware
<Regenaxer>
T
libertas has quit [Remote host closed the connection]
<sriram>
In that pastebin example, what does (csDraw "lines" *PosX *PosY) do?
<beneroth>
I'm still regularly amazed that the hope, that some change to a already "finished" application will not be too hard, turns out to be correct :)
<beneroth>
(if this sentence is understandable... omg)
<sriram>
normally I would cheer for the hockey result...but in present company, not... :)
<beneroth>
Regenaxer, congrats ;)
<Regenaxer>
for Ice hockey?
<beneroth>
well if its something positive, the whole country was of course part of it! but if its negative, its just the particular directly involved people ;)
<Regenaxer>
always :)
<Regenaxer>
"success has many fathers" in German
<beneroth>
Regenaxer, yeah. but I should congratulate you to the picolisp stack once more ;)
<beneroth>
T
<beneroth>
and mothers
<sriram>
:) thats true
<Regenaxer>
ah, ok, thanks! :)
<sriram>
yes...i will add my voice to that as well!
<Regenaxer>
:)
<sriram>
and also for introducing to other (better) ways of doing things...Penti for instance
<sriram>
and for making an emacs user learn more vi :)
<Regenaxer>
haha, ok :)
<beneroth>
1. T 2. hm...
<beneroth>
learning both vi and emacs is good, agreed.
<sriram>
yes...i am not a diehard either way..each has their place
* beneroth
prefers emacs with paredit for lisping. he likes vi for editing files - better for it than all other editors.
<beneroth>
T
<beneroth>
sriram, picolisp habits make you also program better in other languages (the old lisp saying)
<beneroth>
at least so I observed on myself
<Regenaxer>
I never managed to learn emacs. Used it for a few months only, and only viper mode
<beneroth>
sriram, not necessarily the language constructs, but the habit of YAGNI and KISS which is so deeply part of Regenaxers work.
<beneroth>
results in truly better maintainability
<beneroth>
and better stability :)
<sriram>
yes...(i have observed a little (infancy) in myself too...but yes, language constructs not so easy to transfer to say c++)
<sriram>
YAGNI?
<beneroth>
You Aint Gonna Need It
<sriram>
ah thanks
<sriram>
(google and beneoth :) )
<beneroth>
leave away what you don't need NOW
<beneroth>
yeah I got it from the c2 Wiki :)
<Regenaxer>
Rooted in extreme programming
<beneroth>
yeah c2 Wiki is the original first wiki on the web, home to extreme programming (previous iteration of the current agile fashion) and home to the concept of "design patterns"
alexshendi has joined #picolisp
<Regenaxer>
I would not use the term, as "extreme" makes sense only to measurable values
<Regenaxer>
extreme temperature
<beneroth>
hm. I've never asked myself if Regenaxer is doing XP. good point. hm.
<Regenaxer>
So I would rather say no
<Regenaxer>
extreme programming sounds like 1000 lines per minute
<beneroth>
"The methodology takes its name from the idea that the beneficial elements of traditional software engineering practices are taken to "extreme" levels."
<beneroth>
so.. no real meaning, just buzzword marketing ;)
<Regenaxer>
yeah :)
<Regenaxer>
T
<sriram>
I also stayed away from this movement because of that
<sriram>
feeling
<beneroth>
"it advocates frequent "releases" in short development cycles"
<Regenaxer>
well, this is true for pil
<beneroth>
"programming in pairs or doing extensive code review, unit testing of all code, avoiding programming of features until they are actually needed, a flat management structure, code simplicity and clarity, expecting changes in the customer's requirements "
<Regenaxer>
almost a release per day
<Regenaxer>
or every few days
<beneroth>
this is also true, insofar when multiple picolispers are involved
<sriram>
(do you use git internally for revision control, if i may ask)
<beneroth>
I do
<Regenaxer>
All that applies, just the name ...
<beneroth>
Regenaxer has his own system
<sriram>
oh...i use git and love it...was wondering what pil uses
<beneroth>
he uses some bash and picolisp scripts, but locally works similar to git kinda (versioned backup)
<sriram>
i remember asking that one time long ago
<Regenaxer>
pil does not use git directly
<sriram>
yes..diff based
<beneroth>
I use git.
<sriram>
i think?
<Regenaxer>
sriram, right
<beneroth>
kinda. not based on the tool "diff"
<beneroth>
afaik
<Regenaxer>
incremental snapshots
<Regenaxer>
calls 'diff' too
<beneroth>
ah right. right
<Regenaxer>
between local files, and files in the snapshots
<beneroth>
so based on 'diff', but not 'patch'
<Regenaxer>
T
<Regenaxer>
"programming in pairs" is also what we did many years
<Regenaxer>
With Josef, but also with Srini
<Regenaxer>
and recently with Vid
<beneroth>
yeah 'pair programming' is good methodology
<Regenaxer>
beneroth, btw, Vid showed up again
<sriram>
(one thing that used to amaze me was how fast he would find the bug if in some internal lib..and how quick it was to deploy the fix)
<beneroth>
Regenaxer, yeah?
<Regenaxer>
We talked in WhatsApp, will continue the project
<beneroth>
sriram, its nice that picolisp has not the "too many turtles" problem usually.. just the VM layer and the picolisp layer. and/or third party stuff. easy to go through.
<beneroth>
Regenaxer, good :)
<Regenaxer>
oh, some duties
<Regenaxer>
sorry
<beneroth>
Regenaxer, even if it goes slowly, introducing SAP instead would have probably not been quicker. and extremely more expensive :D
<sriram>
beneroth yes> however for myself...i find myself trying to learn the different aspects (DB, GUI, Pilog, OS)
<Regenaxer>
I will stop for today
<beneroth>
cu Regenaxer !
<sriram>
so even if no layers, lots of features
<beneroth>
T
<Regenaxer>
beneroth, exactly
<sriram>
thanks, bye :)
<Regenaxer>
bye, I let the client running anyway, look tomorrow :)
<beneroth>
sriram, it needs some "kneeling-in" to get into a new subarea of picolisp universe. quite a hustle. but when the AHA enlightenments moments ("got it!") its pretty worth it
<sriram>
yes....thats what I feel exactly..even on small achievements
<sriram>
or understanding some pil code from rosetta
<beneroth>
also most stuff can be learned quickly when one has overcome the fear and actually goes into it. I managed to learn most of pilog in like 2 nights when I had to :D
<beneroth>
T
<sriram>
oh thats wonderful!
<sriram>
yes, thats why i am delving slow and deep into this pdfPage
<sriram>
even if it takes time, learning lots on the way...with lots of help too :)
<beneroth>
the biggest obstacle I find is previously learned concepts, resulting in wrong (and, in hindsight, irrational) assumptions
<sriram>
yes..misunderstanding of when to apply quote also hinders me in writing...especially when inside form at second layer etc
<sriram>
i mean to add '
<beneroth>
I mean stuff which is true for other tech stacks but not necessarily make any sense with picolisp. because picolisp is just took such a different route - or, often, just took a step back and went more abstract (and simpler) then other implementations
<sriram>
ahh...i did not find that much I think..because I mostly use c and c++ like languages
<beneroth>
(the other implementations than added needlessly additional limits and requirements, which make sense when one sees their history, but actually not when looking at the bigger picture)
<beneroth>
ok
<sriram>
not counting scripting languages
<sriram>
i experimented with some flavors of lisp before
<sriram>
and also prolog
<beneroth>
yeah C/C++ background helps a lot for learning software stuff in general, I found, because one can picture the underlying instructions
<sriram>
but nothing kept drawing me back like pil.
<beneroth>
my first language was C++, helped me a lot
<beneroth>
hehe
<beneroth>
good :D
<sriram>
:) started with Pascal or perhaps Basic almost 30 years ago.
<sriram>
but luckily reached c not too much later
<beneroth>
ah, you're a veteran :) not a youngling like me
<sriram>
i am a toddler...a pil toddler...:)
<beneroth>
toddling never ends truly
<sriram>
but the road is very enjoyable
<beneroth>
yeah. I regularly program in picolisp and C# and SQL currently. pil is much more fun :)
<sriram>
with surprises, and rewards. like no language i have encountered
<beneroth>
T
<sriram>
yes indeed..
<beneroth>
and mostly good surprises! :D
<sriram>
true...there have been some not so pleasant ones...and when i delved into..almost always my misunderstanding..so still good
<beneroth>
same
<sriram>
when i say not so pleasant, i mean unexpected
<sriram>
so still valuable....eventually i hope to write this with the same ease i dash off
<sriram>
a sed/awk/bash/perl/ script
<sriram>
but long way to go yet
<sriram>
nice talking with you...must get back to my pdfPage
<sriram>
:)
<beneroth>
thanks, I thank you :)
<sriram>
bye now :)
sriram has quit [Quit: Page closed]
orivej has quit [Ping timeout: 265 seconds]
reed has joined #picolisp
<reed>
Hi All. I'm trying to better understand how "task" works. If I have a joystick connected via usb, can I use task to monitor "/dev/input/js0"?
orivej has joined #picolisp
<beneroth>
hi reed, welcome :)
<beneroth>
this is certainly possible. see the reference for *Run, e.g. listening to a file pointer
<reed>
HI Beneroth, I have been reading *Run and task documentation quite a bit and I still can't quite figure out how to get it to work
<beneroth>
you could use (open "/dev/input/js0") to get a file pointer to work with
<reed>
If I just wanted to print out the binary input, would prg be (pr (rd @))
<reed>
Something like (setq js-fd (open "dev/input/js0")) followed by (task js-fd (pr (rd js-fd)))?
<beneroth>
(pr) "prints" in "encoded format", meaning PLIO (picolisp IO binary format). that's not human-readable, but a binary format for communication between picolisp processes.
<reed>
I see
<beneroth>
try first to do it without task
<beneroth>
make it work in the repl, and then you can move it into a task to have it run automatically in the background
<reed>
Would I do that with "wait"?
<beneroth>
(wait) is a bit comparable to (sleep) in other languages, but it also checks all installed tasks and executes the picolisp IPC (if you have multiple picolisp processes started by the same picolisp parent process)
<beneroth>
maybe better (hear) ?
<beneroth>
ah no
<beneroth>
nonono
<beneroth>
(hear) is only meant to be connected to pil processes
<beneroth>
maybe something like (in "/dev/input/js0" (and (rd 1) (bin @))
<beneroth>
(rd 1) - read one raw byte in big endian format
<beneroth>
(rd -1) for reading one raw (not plio encoded) in little endian
<beneroth>
(in "/dev/random" (and (rd 1) (bin @)))
<beneroth>
-> "101100
<beneroth>
(bin @) - print a number as a binary string. @ is given here as argument, its the result of the previous execution, stored there because we're in (and)
<beneroth>
I hope this helps you a bit
<beneroth>
I haven't much experience with (task)
<reed>
Thanks, that's doing something!
<beneroth>
what is your timezone? in about 8 to 10 hours Regenaxer will be active here again, he is the author of picolisp and will gladly help you :)
<reed>
Pacific Standard Time
<beneroth>
yeah not so much activity here during your main time. Regenaxer is in Germany. though the whole community is spread out all over the globe.