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
corecheckno has joined #picolisp
corecheckno has quit [Remote host closed the connection]
corecheckno has joined #picolisp
corecheckno has quit [Remote host closed the connection]
corecheckno has joined #picolisp
corecheckno has quit [Remote host closed the connection]
corecheckno has joined #picolisp
corecheckno has quit [Remote host closed the connection]
theruran has quit [Quit: Connection closed for inactivity]
geri has joined #picolisp
geri has left #picolisp [#picolisp]
geri has joined #picolisp
<geri> hey, i sent the file to mailing list :)
<abu[7]> Yeah, good! I've read it.
<geri> now back to the lsp server :D
<abu[7]> I added an example for error catching and logging to the 'catch' reference
<abu[7]> The pattern is a bit tricky
<abu[7]> using 'if2'
<geri> good, ill note to check it on next update
<abu[7]> No hurry
<abu[7]> Released a PilBox update to PlayStore
<abu[7]> Should be visible soon
<geri> and of course i find a bug as soon as i post the email with my library
<geri> xd
<abu[7]> oh
<abu[7]> Perhaps post it with a short article to the wiki? Then you can update it any time.
<geri> (let S (chop "[123, 456]") (input (++ S) (json-read)))
<geri> this one bugs out and returns (array 123 23 3 456)
<geri> just read works fine
<geri> hmmm
<geri> (pipe (prinl "[123, 456]") (json-read))
<geri> works fine
<geri> uhhh
<geri> (de json-read-from-string (S) (let S (chop S) (input (++ S) (json-read)))) full function
<abu[7]> strange
<geri> if i name it Str everywhere instead of S it works
<geri> your turn to guess xd
<geri> ah maybe
<geri> im using S in json-read-number
<geri> maybe they interfere
<geri> somehow
<abu[7]> Yes, probably
<abu[7]> reading happes deeply nested
<abu[7]> (++ S) is always executed whenever a new char is needed
<abu[7]> Nasty indeed
<geri> amazing
<abu[7]> S needs to be protected
<geri> how to do it
<geri> well, i think im the only one who can break it this way, cause when you do json-read itll override S anyway
<geri> so protected from myself
<geri> :D
<abu[7]> (let "S" (chop ..) (input (++ "S")
<abu[7]> ugly
<geri> (de json-read-from-string (S) (let String (chop S) (input (++ String) (json-read))))
<abu[7]> and a bad source of error
<abu[7]> String is not safe
<abu[7]> S must be private
<abu[7]> ugly
<geri> :(
<geri> (de json-read-from-string (S) (let "Input" (chop S) (input (++ "Input") (json-read))))
<geri> ill do this then
<abu[7]> Yes, this is good
<geri> okay, now about the wiki
<geri> gotta sign up?
<abu[7]> Yes
<geri> god bless keepassxc
<geri> it generates passwords for you, nice
<abu[7]> I generate my passwords via (in "/dev/urandom" (rd 12)))
<geri> only numbers tho
<geri> (pack (make (do 20 (link (char (in "/dev/urandom" (rd 1)))))))
<geri> maybe
<geri> :D
<geri> wait, need 1 in and 20 rd's
<geri> 쓝⬱闲繪ᇷ섻᤭怠䇭裗澓遤ꑕ櫲쵽ケ烞
<geri> now that's an amazing password
<abu[7]> :)
<geri> yeah that's nice
<geri> does it take long to get email for picolisp.com acc
<geri> maybe i messed something up with the email address xd
<abu[7]> Should be immediate
<geri> lets try again...
<abu[7]> I see the user
<abu[7]> (select +User nm "geri")
<geri> then probably wrong email or smth
<geri> fun
<abu[7]> em "g.b...h@gmail.com"
<geri> ye
<geri> weird
<abu[7]> Hmm, maybe the wiki is outdated
<abu[7]> Nobody registered since a long time
<abu[7]> Let me check the mail sending
<geri> should be same one as on email thread
<abu[7]> Tested, mail sending from wiki works
<geri> and its not in spam either
<abu[7]> Yes, the mail address is identical
<geri> the website doesnt accept me...
<abu[7]> The mail is just a confirmation
<abu[7]> login should work
<abu[7]> user + pw
<geri> it said itd send the password to email...
<abu[7]> True, it sends the pw back by e-mail
<abu[7]> not a good idea
<abu[7]> But does not explain w
<abu[7]> hy you can't log in
<abu[7]> or get the mail
<geri> cause i dont have a password
<geri> cause i didnt get the email yes
<geri> :D
<abu[7]> Ah
<abu[7]> It generates the pw for you?
<abu[7]> Did not remember
<geri> apparently
<geri> if you click create account top window only has "login name", "email address" and "full name (optional)"
<abu[7]> So the mail problem remains
<geri> yeah
<abu[7]> T
<abu[7]> The mail was lost
<abu[7]> ok, I change the pw to "abc" and you change it then
<abu[7]> moment
<geri> okay
<abu[7]> done
<abu[7]> Login worked
<geri> yup
<geri> let me try with new pw
<abu[7]> ok
<abu[7]> User Admin
<geri> worked
<geri> yay
<abu[7]> 👍
<geri> where would the parser make sense to add
<abu[7]> Not sure. Since Eric changed all and removed the menu, I'm lost too ;)
<geri> xd
<abu[7]> Documentation / Examples ?
<abu[7]> Perhaps a new entry below "A collection of PicoLisp examples" ?
<geri> makes sense, let me figure out how the page tree works
<abu[7]> ok
<geri> i feel so dumb
<geri> how do you make a new page
<abu[7]> First make the new entry, then click on it
<geri> okay, managed to create a new link
<geri> :D
<abu[7]> Perfect
<abu[7]> Did you find this! https://picolisp.com/wiki/?help
<geri> yeah
<abu[7]> cool
<abu[7]> I had trouble finding it ;)
<geri> empty!
<abu[7]> Good! This link is not permanent though
<abu[7]> T
<geri> im using code tag wrong, sec
<geri> or does it just make it all single-line in any case?
<geri> wow yes it does
<geri> ouch
<geri> aha nvm
<geri> got the code in
<geri> now to write about it :)
<abu[7]> :)
<geri> nvm food
<abu[7]> Where did you put the start link?
<abu[7]> I can only find it via Search
<abu[7]> OK, must stop now
<abu[7]> bbl
<geri> start link is in per-category page cause i couldnt categorize it otherwise xd
<geri> is \0 not allowed in string names for CFFI's sake?
<geri> now with all the writeups
<abu[7]> Not for CFFI, but because it is padding
<geri> oh, if it doesnt use every bit of a cell?
<abu[7]> The name has 8 bytes per cell and 7 in the last CDR
<abu[7]> So we need a terminator
<geri> okay, makes sense
<geri> thats like the only bit that invalidates the "RFC8259-compliant" thingie :(
<geri> but its 99.9% compliant, so good enough :D
<geri> ive posted about the wiki page
<abu[7]> :D
<abu[7]> Cool!
<geri> am i a contributor yet
<geri> :D
<abu[7]> sure!
<geri> hehe
<geri> btw, why is name of a symbol encoded in last cdr of its plist and not the first car instead?
<abu[7]> property access should be faster than name access, because the name is needed mainly for I/O which is slow anyway
<abu[7]> And a minimal system of one cell has only a CAR (value) and a CDR (name)
<abu[7]> s/system/symbol
<geri> fair enough
<geri> what is actually better - reading char by char or trying to read everything into memory?
<geri> im guessing first one uses less memory but maybe slower and second one the opposite way
<abu[7]> What reading do you think of? Sexprs?
<geri> mostly json, but also applies to sexprs i guess
<abu[7]> or, what *can* be read into memory?
<abu[7]> 'read' reads into memory first (buffer)
<geri> yeah and then you can operate on it
<abu[7]> just byte by byte
<abu[7]> buffer is only for efficiency
<geri> okay
<abu[7]> read does only a single-byte look-ahead
<geri> with (peek)?
<abu[7]> (peek) is just a function to access this single char
<abu[7]> the global $Chr
<geri> haha, ofc its a global
<abu[7]> (vi 'llvm~$Chr)
<geri> when implementing my own "unread" functionality in python i had to have a variable for the latest char too
<geri> q: does it mean when you do (char) it actually just returns you whatever was in $Chr and read a new char into there, available for (peek) again?
<abu[7]> Yes, exactly
<geri> is that how peeking in C works as well?
<abu[7]> plus additional byte
<abu[7]> s
<abu[7]> I don't know a C peek fun
<geri> right
<geri> nvm, its got ungetc instead
<abu[7]> a char in pil may he up to 4 byte
<abu[7]> T, stdio
<geri> i would guess it works in a similar way, just storing it in some variable upon doing ungetc and un-storing it when you read 1 char
<geri> hm
<abu[7]> I think so too
<geri> how large is $Chr overall?
<abu[7]> Just an int
<abu[7]> it holds only one byte
<abu[7]> so (char) or (peek) may trigger further fetches
<geri> but yeah, utf-8 chars can be up to 4 bytes...
<geri> ah
<abu[7]> T
<abu[7]> For the look-ahead a byte is enough
<abu[7]> ASCII only
<abu[7]> delimiters
<abu[7]> abc(def)
<abu[7]> read should return 'abc'
<abu[7]> next read the list (def)
<geri> yeah
<geri> is ungetting vs peeking largely a preference thing?
<abu[7]> Depends what ungetting can do
<abu[7]> Can you unget more than one?
<geri> i think no
<abu[7]> So it is the same
<geri> okee
<geri> thanks
<geri> why is (char) when called on top level of a script not reading from stdin?
<geri> or more like, should i be doing (in 0 (char))?
<abu[7]> When 'load'ing a file, the current input channel is the file itself
<geri> huh
<geri> worked with (in 0 ...)
<abu[7]> yes, or (in NIL ...)
<abu[7]> (pp 'private)
<abu[7]> calls (read)
<abu[7]> so it reads the *next* expression
<abu[7]> (load "file") is basically (in "file" (while (read) (eval @]
<geri> aha
<geri> that's fun
<geri> gotta go, have fun
<abu[7]> o/
geri has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.4)]