ChanServ changed the topic of #picolisp to: PicoLisp language | Channel Log: https://irclog.whitequark.org/picolisp/ | Picolisp latest found at http://www.software-lab.de/down.html | check also http://www.picolisp.com for more information
alexshendi has quit [Ping timeout: 256 seconds]
alexshendi has joined #picolisp
f8l has quit [Ping timeout: 246 seconds]
f8l has joined #picolisp
orivej has quit [Ping timeout: 268 seconds]
aw- has joined #picolisp
<viaken> Most people who would need to see that probably wouldn't accept that source, but ...yeah. That's a thing.
<clacke[m]> i .. whu ...
alexshendi has quit [Ping timeout: 255 seconds]
karswell has quit [Read error: Connection reset by peer]
karswell has joined #picolisp
rob_w has joined #picolisp
<beneroth> hi all
<Regenaxer> Hi beneroth
<beneroth> Hi Regenaxer :)
alexshendi has joined #picolisp
orivej has joined #picolisp
orivej has quit [Ping timeout: 256 seconds]
orivej has joined #picolisp
<tankfeeder> hi all
<tankfeeder> (((lena kate) . 100) ((mike lena) . -45))
<tankfeeder> i need something like this ^^^. Dictionary access on two persons with value.
<tankfeeder> any hints ?
<Regenaxer> Hi tankfeeder
<Regenaxer> rassoc?
<tankfeeder> o
<tankfeeder> aaa
<tankfeeder> let me try
<aw-> hi tankfeeder
<aw-> interesting question..
<aw-> i did something similar to this recently
<tankfeeder> done
<tankfeeder> works
<Regenaxer> ok
<cess11> When was 'rassoc introduced?
<tankfeeder> 21feb15
<cess11> : (version)
<cess11> 3.1.8.0
<cess11> -> (3 1 8 0)
<cess11> Doesn't look right. Is Debian that much behind?
<tankfeeder> does your json parser can help this part of task ?
<Regenaxer> cess11: Debian testing is now on (17 12 26)
<Regenaxer> Stable on 16.12.8
<cess11> This is Jessie, tried reinstalling, it seems the package and version it gets are picolisp_3.1.8.0_amd64.deb.
<cess11> *is
<Regenaxer> yeah, sorry, it is stretch
<Regenaxer> on Jessie I have 3.1.8.0-4
<Regenaxer> Debian is always *very* outdated :(
<cess11> Right, same, with -4. I think I'll need to set up some scripts and only build from the rolling release on this machine.
<aw-> tankfeeder: yes, seems like valid JSON.. i just loaded the input and it was parsed correctly
<aw-> also checked with online JSON validator, and it passed
<tankfeeder> aw-: yes, its valid, what about skip numbers if red in object ?
<aw-> well once the data is in a JSON list, then it's up to you to figure out how to "parse" it
<aw-> correction: once the data is in PicoLisp list
<aw-> my parser only converts JSON to Pil lists
alexshendi has quit [Read error: Connection reset by peer]
<tankfeeder> i see, the same as buildin json.l
<aw-> probably
<cess11> 'red will always be before ;, right? It would easy to do an initial check for red; with 'match and either fish out numbers in the entire line or just what's left after 'reverse and 'member/similar.
<cess11> If that is enough it is easier than using a JSON parser, but it could probably be easy too, just put an extra check on the stream in the block that works inside {} that stops the parsing and goes directly to printing the sum.
<cess11> Or if one can be sure 'red is always an attribute 'match for just this would be good enough I think.
<aw-> yeah there's likely many ways to solve that problem
mtsd has joined #picolisp
<tankfeeder> new price dumper
<beneroth> hetzner is pretty good, one of the biggest providers in Germany
<beneroth> though they were among the first ones to forbid mirroring wikileaks on their servers back in 2010 (forbidding wikileaks without any legal reason)
<beneroth> this generated some backslash, so they changed their mind again to allow it until someone comes with a warrant (which afaik never happened)
<clacke[m]> 2.5 EUR for 2 GB RAM, wow
<viaken> Dang
<viaken> I think I'm paying 5 USD for 0.5GB currently.
<viaken> It's all in Ansible, though. Wouldn't be a hard transition.
mtsd has quit [Ping timeout: 260 seconds]
<joebo> hi all
<joebo> I'm stumped on fish
<joebo> I want to exclude all lists/sublists that have a 1 in them
<joebo> I would have though this would work
<joebo> : (fish '((X) (not (member 1 X))) '(1 (2 1 3 4)))
<joebo> -> (((2 1 3 4)))
<Regenaxer> Yeah, such negation is difficult with 'fish'
<Regenaxer> It stops when it *finds* a sublist which satisfies the condition
<Regenaxer> Try this: (fish '((X) (nor (find pair X) (member 1 X))) '(1 (2 1 3 4)))
<Regenaxer> This excludes all lists which have sublists, not sure if it what you need
<joebo> Regenaxer: thanks! It's close
<Regenaxer> The list (1 (2 1 3 4)) doesn't need a quote btw
<joebo> bad habit :)
<Regenaxer> no problem
<joebo> this seems to do the job of what I'm looking for
<joebo> (let L (list (1 (2 1 3 4))) (recur (L) (make (for C L (link (if (not (atom C)) (if (not (member 1 C)) (recurse C)) C))))))
<Regenaxer> good, self-made "fish" :)
rob_w has quit [Remote host closed the connection]
<joebo> that solves part2 tests
<joebo> I didn't try the full input though
<joebo> that was tricky!
<tankfeeder> ah, you did it.
<tankfeeder> lets try on full input.
<tankfeeder> on full input returns 0
<tankfeeder> :)
<joebo> hehe
<joebo> darn!
<joebo> how did you injest the full input? I can troubleshoot
<joebo> ingest
<joebo> I see
<tankfeeder> this is fuill
<joebo> (setq Input (in "/mnt/c/temp/input.json" (line)))
<tankfeeder> yea, for example
<tankfeeder> already choped
alexshendi has joined #picolisp
<tankfeeder> parse returns something, filterRed returns NIL
<joebo> well noRed is finding a match
<joebo> hmm
<joebo> : (match (list '@X ~(chop "\"red\"") '@Y) (car (parse Input)))
<joebo> -> T
<joebo> seems like this check may not be right
<joebo> or there is tricky data in there :)
<tankfeeder> eh
<tankfeeder> i'm playing without output from json.l
<tankfeeder> parser
<tankfeeder> output examples from json.l
alexshendi has quit [Ping timeout: 256 seconds]
<joebo> tankfeeder: I may have a fix
<joebo> can you see if 68466 is the right answer
<tankfeeder> yes, correct
<joebo> updated the gist
<joebo> I didn't account for nested arrays in my initial implementation
<joebo> great!
<tankfeeder> aha, i see the diff.
<tankfeeder> ok
<joebo> actually, the nested arrays didn't make a difference... it was testing for :"red" that fixed it
<joebo> instead of "red"
<joebo> either way!
<joebo> cool
<tankfeeder> commited, reference to you, day 14 tomorrow
<tankfeeder> thanks.
<joebo> my pleasure - fun problem :)
aw- has quit [Quit: Leaving.]
alexshendi has joined #picolisp
karswell has quit [Ping timeout: 248 seconds]
alexshendi has quit [Ping timeout: 256 seconds]
alexshendi has joined #picolisp
<beneroth> rofl
<beneroth> amazon sells "Amazon smart phones". apparently some are sold cheaper but have ads on the lock screen.
<beneroth> apparently, clicking on this ads unlocks the phone reliably.
alexshendi has quit [Ping timeout: 256 seconds]
alexshendi has joined #picolisp
alexshendi has quit [Read error: Connection reset by peer]
karswell has joined #picolisp
karswell_ has joined #picolisp
karswell has quit [Read error: Connection reset by peer]