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
<beneroth> yeah. well I handle them as integers and also store the scale :)
teddydd has quit [Read error: error:0A000119:SSL routines::decryption failed or bad record mac]
teddydd has joined #picolisp
<aw-> yeah fixpoint
<aw-> rick42 wrote an amazing article on that
f8l has joined #picolisp
bjorkintosh has quit [Ping timeout: 260 seconds]
bjorkintosh has joined #picolisp
chexum has quit [Remote host closed the connection]
chexum has joined #picolisp
<abu[7]> Well, this lib/json.l was there first. A simple mapping of s-exprs to Json. Yes, for a full syntax support OOP in symbols is better.
<abu[7]> aw-: The problem is not the parser
<abu[7]> It is the printer
<abu[7]> cause lists are ambigous
<abu[7]> is (a b c) = {a, b, c} or is it a: {b: c} ?
<abu[7]> I'll define it as the latter
<abu[7]> Will do later
<abu[7]> lib/json.l existed, so it should be made as correct as possible. If something more complete is needed, aw-'s lib should be used
<abu[7]> Correction: In "I'll define it as the latter" I meant "as the first"
ygrek has quit [Remote host closed the connection]
rob_w has joined #picolisp
rob_w_ has joined #picolisp
<aw-> i thought you were using T as cdr to determine if it's a list (array)
<aw-> i used that as inspiration for my lib
<tankf33der> Morning
<tankf33der> abu[7]: i will official json lib as long as possible
<tankf33der> will wait
<tankf33der> i meant
<abu[7]> am
<abu[7]> aw-, T in the CAR
<abu[7]> This feature war removed for a reason I don't remember, so we (tankf33der and I) thought we might as well re-introduce it
<aw-> err yes sorry
<tankf33der> abu[7]: Approximately when will it be ready?
<abu[7]> Not sure. Will start now, but probably lots of interruptions
<abu[7]> Surely something today
<abu[7]> (maybe give up ;)
<tankf33der> Thanks
<abu[7]> Let's first find out the limits of the syntax
<tankf33der> As soon as you start implementing everything according to BNF, it will follow that your library will support everything.
<abu[7]> I don't look at BNF
<tankf33der> i knew it :)
<abu[7]> I go the opposite direction
<abu[7]> Start from s-expr
<tankf33der> ok
<abu[7]> bottom up
<abu[7]> OK, I have a proposal
<abu[7]> What do you think of this? http://pb1n.de/?48cc06
<abu[7]> Source (no packJson yet): http://pb1n.de/?430155
<tankf33der> i does not cover situation i need
<tankf33der> {"mike": [{"1": "2", "2": "2"}, {"1":"2","3":"4"}]}
<tankf33der> this one
<tankf33der> meeting in 20mins
<tankf33der> rest are perfect.
<abu[7]> I think it covers
<tankf33der> ok then
<abu[7]> (printJson '(a . (T ((b . 1) (c . 2)))))"a": [{"b": 1, "c": 2}]-> "]"
<abu[7]> or just (printJson '(a T ((b . 1) (c . 2)))) of course
<abu[7]> My tests pass so far
<abu[7]> I'll change packJson the same way
<abu[7]> Done
<abu[7]> I release it now, In any case better than the old version :)
<tankf33der> So prinjson and readjson is done, right?
<abu[7]> No changei in read, only pack and print
<abu[7]> Released
<abu[7]> Test is now http://pb1n.de/?b61024
<tankf33der> Doing
<abu[7]> Thanks
<tankf33der> Should i play with released version or version from pb1n?
<abu[7]> Released version, as both should be the same
beneroth has quit [Quit: Leaving]
<tankf33der> json test suite passed
<abu[7]> Cooool! ☺
<tankf33der> a, readjson not changed. anyway all is ok
<abu[7]> Thanks for starting this issue! I never cared much about Json except the simple cases.
<tankf33der> learning new printjson
<abu[7]> In fact I never really needed readJson (or parseJson). Just 'from' and 'till' is a lot simpler and faster to extract data from a Json stream.
<tankf33der> my real life use case is jsons for-from monero-wall-rpc
<taleon> Unfortunately, most JavaScript web frameworks now use JSON to communicate with the backend. I'm not a big fan of it either, but the need and demand for it is there. Thanks for the change too.
<abu[7]> Yeah, readJson is good if you need all data from a request
<abu[7]> But a handful of data is faster with 'from' and 'till'
<abu[7]> taleon, true
<abu[7]> OK, I use readJason in the matrix test code, but this is only to get the whole bunch of data in a single transaction to study it
<abu[7]> In an application, when you need say a number and a string, you'd just say:
<abu[7]> (use (S N) (from "\"str\":") (setq S (till "," T)) (from "\"num\":") (setq N (format (till ","))))
rob_w has quit [Ping timeout: 248 seconds]
rob_w has joined #picolisp
ygrek has joined #picolisp
<tankf33der> sent successfully money via monero from picolisp. json works.
<abu[7]> 👍
rob_w has quit [Ping timeout: 252 seconds]
beneroth has joined #picolisp
rob_w_ has quit [Read error: Connection reset by peer]
bjorkintosh has quit [Remote host closed the connection]
bjorkintosh has joined #picolisp