ChanServ changed the topic of #picolisp to: PicoLisp language | Channel Log: https://irclog.whitequark.org/picolisp/ | Check also http://www.picolisp.com for more information
freeemint has quit [Remote host closed the connection]
freeemint has joined #picolisp
ubLIX has quit [Quit: ubLIX]
freeemint has quit [Ping timeout: 245 seconds]
Blue_flame has joined #picolisp
Blue_flame has quit [Client Quit]
orivej has quit [Ping timeout: 245 seconds]
mtsd has joined #picolisp
orivej has joined #picolisp
beneroth has joined #picolisp
cil_z has joined #picolisp
cil_z has quit [Ping timeout: 246 seconds]
cil_z has joined #picolisp
<cil_z> good morning
<Regenaxer> Good morning cil_z
cil_z has quit [Ping timeout: 246 seconds]
cil_z has joined #picolisp
<cil_z> it works well but it's slower than the solution given yesterday!
<beneroth> Good morning cil_z, Regenaxer :)
<cil_z> hello beneroth
<Regenaxer> Hi beneroth
<Regenaxer> cil_z, what is slower?
<cil_z> my solution to get a month in full text
<cil_z> this one: (pipe (call 'date (pack "--date=" Dat) "+%B") (read))
<Regenaxer> ah, I see
<cil_z> sorry: (pipe (call 'date (pack "--date=2019-09-26") "+%B") (read))
<Regenaxer> pipe + call is not a good idea anyway
<Regenaxer> (in '(date) ...
<cil_z> yes i see that!
<Regenaxer> call is not supposed to produce readable output
<cil_z> ok
<cil_z> is there any way to make a "group by" with pil database?
<cil_z> for example
<Regenaxer> only on the list level, with 'group'
<cil_z> any example?
<Regenaxer> Not sure what is published
<Regenaxer> eg (by '((This) (: dat)) group (collect 'nm '+Cls ...]
<Regenaxer> For grouping, all data needs to be prefetched anyway
<cil_z> tkx I will have a look...
ubLIX has joined #picolisp
<cil_z> can I use 2 or more rel in the by close like this (by '((This) (: year) (: month))...]?
orivej has quit [Ping timeout: 265 seconds]
<Regenaxer> Sorry, phone
<beneroth> cil_z, no, as your anon function only returns (: month) then. put them in a list:
<beneroth> (by '((This) (list (: year) (: month))) ...)
<cil_z> got nothing
<beneroth> show some code
<cil_z> Beneroth, I try this: (by '((This) (list (: year) (: week))) group (collect 'id '+Agenda))
<cil_z> it results in NIL
<Regenaxer> done
<Regenaxer> Does the collect by itself return something?
<cil_z> this one works: (by '((This) (: week)) group (collect 'id '+Agenda))
<Regenaxer> What is intended by grouping with 2 attributes?
<Regenaxer> All with both equal?
<Regenaxer> should work
<Regenaxer> if 'list'ed (or better 'cons'ed to save space)
<cil_z> sorry guys
<cil_z> this one works: (by '((This) (list (: year) (: week))) group (collect 'id '+Agenda))
<cil_z> tkx
<Regenaxer> perfect :)
<Regenaxer> 'cons' would too
<beneroth> T
<beneroth> replace list with cons
<cil_z> ok
<beneroth> list -> last cdr cell is NIL
<beneroth> cons -> use last cdr cell for last value
<Regenaxer> phone again
<beneroth> cil_z, what was wrong at first? I see no difference in the code you posted here?
<cil_z> I think it was an issue with my database in REPL!
<cil_z> I had to reload it
mtsd has quit [Ping timeout: 276 seconds]
<beneroth> ah
<beneroth> :)
<beneroth> bbl, time for lunch
<cil_z> bon appétit!
mtsd has joined #picolisp
<tankf33der> Regenaxer: ping
<tankf33der> afk.
lodsw has quit [Ping timeout: 245 seconds]
ubLIX has quit [Quit: ubLIX]
lodsw has joined #picolisp
mtsd has quit [Quit: Leaving]
<cil_z> does "week" return an iso week?
<cil_z> because I would expect (week ($dat "2019-12-31" "-")) to return "01" for an iso week instead of 53!
<Regenaxer> Sorry tankf33der!
<Regenaxer> I don't know what an iso week is. 'week' uses ts system here in Germany
<Regenaxer> Something with Thursday ...
<Regenaxer> Thursday is here (2020 1 2)
<Regenaxer> : (week (date 2020 1 3))
<Regenaxer> -> 1
<Regenaxer> (ISO 8601, was: DIN 1355-1)
<cil_z> iso week says that if the number of days of the last week of one year is >=4 then this week belongs to this year else it belongs to the new year
<Regenaxer> In USA it seems to be different (Wikipedia). The first week is the one that holds first of January
<cil_z> looks like there are many conventions...
<Regenaxer> the week with the year's first Thursday in it
<cil_z> yes I agree.
<cil_z> (week ($dat "2020-01-02" "-")) gives 1 while (week ($dat "2019-12-31" "-")) gives 53. However those 2 days are in the same week!
<Regenaxer> Thus they are not :)
<Regenaxer> Not the same number
<Regenaxer> btw, instead of ($dat "2019-12-31" "-"), (date 2019 12 31) is simpler and faster
<cil_z> yes but according to iso 8601 this whole week should be numbered 1 instead of 53, isn't it?
<Regenaxer> I think 53 is correct
<Regenaxer> it is always relative to the year
<cil_z> T, it was just to understand how things work under the hood ;-)
<Regenaxer> In fact I don't remember when and why I wrote 'week'
orivej has joined #picolisp
<Regenaxer> Maybe as this critical week 53 is at the end of the year when noone is working ("between the years") nobody cares ;)
<Regenaxer> In one of my applications the users can schedule mailings on calendar week number. Nobody complained so far ...
freemint has joined #picolisp
<Regenaxer> bbl
<cil_z> anyway, it's not a big deal. As a way of learning pil, I'm rebuilding with it an app made previously with R... so I'm trying to get the same results...
<cil_z> that was the reason of my question ;-)
<cil_z> as an exercice I may write my own isoWeek function...
<Regenaxer> ret
<Regenaxer> Good :)
freemint has quit [Ping timeout: 240 seconds]
<beneroth> week, year changes and daylight saving times are largely still an unsolved topic xD
<beneroth> SAP used to crash on every daylight saving change (so twice a year) until few years ago
<cil_z> ;-)
<Regenaxer> :D
<beneroth> so whatever pil does is likely "according to modern industry standard and best practice" or better (as that doesn't exist)
<cil_z> T
<beneroth> a client of mine, with a huge internal ERP system, had his administrators get up in the night to restart the servers twice a year (not SAP, issue was caused by their internal programmers, not the system per se)
<beneroth> I tried to explain their IT guys how timezone and daylight saving times work... but I failed. They preferred to continue with the established process...
<beneroth> I even failed at getting across that using an ERP software which automatically converts all times to UTC+0 when saving to the database, mixed with custom database programming which always assumes local timezone, reads and stores date time values following this assumption, might be suboptimal...
<beneroth> people prefer the stuff they know than alien scary concepts....
<beneroth> "know" ^^
<Regenaxer> right
<tankf33der> Regenaxer: ping
<tankf33der> fighting all day.
<tankf33der> (format Lst) and (format (pack Lst)) works differently somehow.
<tankf33der> (format (pack Lst)) *always* OK
<tankf33der> (format Lst) sometimes returns NIL or cut tail of the list
<tankf33der> Lst get from native.
<Regenaxer> Hi tankf33der!
<Regenaxer> oh
freemint has joined #picolisp
freemint has quit [Remote host closed the connection]
<tankf33der> ha
freemint has joined #picolisp
<tankf33der> i've tested without native
<tankf33der> hm.
<Regenaxer> (format 'sym) is the primary version
<tankf33der> or not
<tankf33der> checking again.
<Regenaxer> Accepting a list is an additional convenienve
<Regenaxer> should be the same though, as it packs internally
<tankf33der> repeating.
<tankf33der> testing pil32
ubLIX has joined #picolisp
<tankf33der> tested, pil32 ok, pil64 fail.
<Regenaxer> for example?
<tankf33der> there is the code
<tankf33der> http://ix.io/1X2D
<Regenaxer> Tried on Android, fails indeed
<tankf33der> yea
<tankf33der> (format (pack S)) will be always ok
<Regenaxer> hmm
<Regenaxer> What exactly goes wrong? format or pack?
<tankf33der> format
<tankf33der> returns NIL or cut tail
<tankf33der> like this.
<Regenaxer> If I take your S example:
<Regenaxer> http://ix.io/1X2K
<Regenaxer> it gives T
<Regenaxer> So what *exactly* goes wrong?
<tankf33der> when i do it in loop
<tankf33der> and loop is long
<tankf33der> if i (do 10 ...) it always will be ok
<Regenaxer> So some gc problem?
<Regenaxer> (gc 800) or more before test changes it?
<tankf33der> (gc 64) the same
<tankf33der> (gc 640) is ok
<tankf33der> no
<tankf33der> failed after several minutes
<Regenaxer> :(
<Regenaxer> tough
ubLIX has quit [Quit: ubLIX]
<beneroth> uh
* beneroth finds (format 'lst) handy, too
<beneroth> can you (view) the list you get from native?
<Regenaxer> What means "native" in this context?
<tankf33der> beneroth: too old, i can repeat without native.
<tankf33der> complex core issue.
<beneroth> I understood: list returned from a native call
<tankf33der> http://ix.io/1X2D
<tankf33der> see, without native.
<tankf33der> doing downgrade - v19.2.25 the same
<Regenaxer> How would you use 'native' here?
<beneroth> nothing to do with native, as I understand
<Regenaxer> Anyway I suspect a gc issue
<tankf33der> v17.9.10 - the same
<Regenaxer> Something is not saved
<Regenaxer> It will not depend on the version
<Regenaxer> did not change a long time
<Regenaxer> When gc runs in the wrong moment, it destroys something
<beneroth> is the list corrupted, or is format improperly handling the input?
<Regenaxer> 'link' and 'push' issue
<Regenaxer> I check src64/big.l
<beneroth> if the issue is the list, than shouldn't maybe (pack) take issue too?
* beneroth considers (format) security critical
<Regenaxer> no
<Regenaxer> it must be around line 2151
<Regenaxer> pack may trigger gc
<beneroth> it's gc related, I can confirm
<Regenaxer> and E is not saved perhaps
<Regenaxer> beneroth, you tried?
<Regenaxer> hmm, E is saved
<Regenaxer> line 2094
<beneroth> I tried tankf33ders code, and then the failing Number in separate repl.
<Regenaxer> yes, me too. Stand-alone works
<beneroth> first repl: format of chopped bignum fails, second repl (just this one bignum): works
<Regenaxer> tankf33der is a wonderful tester!
<Regenaxer> I'm busy atm with other things, must continue
<Regenaxer> I debug later
<tankf33der> ok
<tankf33der> afk.
<beneroth> T, thank you tankf33der
<beneroth> so glad to have you here <3
<Regenaxer> Really nasty bug!
<Regenaxer> Hmm, I suspect it is symToNumXA_FE
<Regenaxer> operates on unsaved data
<Regenaxer> I check later! :)
<Regenaxer> line 2156
freemint has quit [Ping timeout: 240 seconds]
<beneroth> thanks Regenaxer
<beneroth> have a nice evening! bbl
beneroth has quit [Quit: Leaving]
orivej has quit [Ping timeout: 245 seconds]
freemint has joined #picolisp
freemint has quit [Remote host closed the connection]
freemint has joined #picolisp
orivej has joined #picolisp
orivej has quit [Ping timeout: 240 seconds]
freemint has quit [Remote host closed the connection]
freemint has joined #picolisp
freemint has quit [Ping timeout: 240 seconds]
<Regenaxer> Investigating the format bug
<Regenaxer> It is as I thought, need to save the return value from 'call packECX_CX'
<Regenaxer> tankf33der's test keeps on running now
<tankf33der> ok, i will try too.
<tankf33der> afk.
<Regenaxer> OK, I release now
<Regenaxer> Thanks a lot tankf33der!!
<tankf33der> i will run infinity loop for hours and it should not fail
<Regenaxer> yes, I hope so ;)
<tankf33der> i use format a lot in my trezor code so i will run and test it in real life too
<Regenaxer> good
orivej has joined #picolisp
<Regenaxer> brb
Regenaxer has left #picolisp [#picolisp]
Regenaxer has joined #picolisp
freemint has joined #picolisp
<tankf33der> tested, issue closed
<Regenaxer> Perfect!
orivej has quit [Ping timeout: 240 seconds]
<Regenaxer> Pil21 minimal repl works
freemint has quit [Ping timeout: 240 seconds]
<CORDIC> Isn't LLVM an unacceptable dependency?
freemint has joined #picolisp
freemint has quit [Ping timeout: 245 seconds]
<Regenaxer> Why dependency?
<CORDIC> If I understand correctly LLVM would be the Machine Code Generator.
<Regenaxer> yess
<Regenaxer> I just generate the "intermediate representation"
<Regenaxer> The LLVM backend generates target machine code
<Regenaxer> So we depend on llvm. A problem?
freemint has joined #picolisp
<CORDIC> Sorry to bother You, it is just that I couldn't find LLVM interesting in any way.
<Regenaxer> No bother at all
<Regenaxer> I just want to use the portability
<Regenaxer> Not interesting in itself for me
<Regenaxer> LLVM does a good job of supporting many backends
freemint has quit [Remote host closed the connection]
freemint has joined #picolisp
freemint has quit [Ping timeout: 265 seconds]
freemint has joined #picolisp
ubLIX has joined #picolisp
cil_z has quit [Ping timeout: 268 seconds]
freemint has quit [Ping timeout: 240 seconds]
freemint has joined #picolisp
freemint has quit [Ping timeout: 240 seconds]
freemint has joined #picolisp
freemint has quit [Ping timeout: 240 seconds]
orivej has joined #picolisp
freemint has joined #picolisp
freemint has quit [Ping timeout: 240 seconds]
ubLIX has quit [Quit: ubLIX]