v_m_v has quit [Remote host closed the connection]
v_m_v has joined #picolisp
calle has quit [Ping timeout: 240 seconds]
v_m_v has quit [Remote host closed the connection]
clacke has quit [Read error: Connection reset by peer]
v_m_v has joined #picolisp
<v_m_v>
Are multiline strings possible in PIL ?
<v_m_v>
(BTW Postgres connector works amazing... it is the easiest way of dealing with postgres with I've even saw)
<v_m_v>
and my another question. I have an Array of tuples ((("string as a UUID" value)) (("string as UUID" value)))....etc How I can sum all of the values in that nested arrays?
<Regenaxer>
Multiline? Like "abc\def\ghi" ?
<Regenaxer>
or lists of strings? ("abc" "def" "ghi")
<Regenaxer>
(sum cdr List)
<Regenaxer>
or (sum cadr List) if they are not cons pairs
<Regenaxer>
hmm, one more nesting ;) (sum cadar List)
<v_m_v>
and I would like to get sum of all of the nested numbers
<v_m_v>
those numbers are also as a strings so I have to format them ...and they a floating points numbers :/
<Regenaxer>
: (sum '((X) (format (cadar X) 6)) L)
<Regenaxer>
-> 204492460632639
<Regenaxer>
Not sure about the scale
<Regenaxer>
pick a suitable one
<v_m_v>
ehhhh it is funny when you are solving my issue with a one line...and my solution has used recursion and took me over 15 lines of complicated code
<v_m_v>
floating point numbers are still a mistery for me ..in PIL
<Regenaxer>
oh :)
<v_m_v>
How I can now convert it into string with dot on a 6-th place?
<Regenaxer>
again with format
<Regenaxer>
: (format 204492460632639 6)
<Regenaxer>
-> "204492460.632639"
<Regenaxer>
or (round ...) which uses *Scl
<Regenaxer>
(doc 'format) or (doc 'round)
<v_m_v>
thx
<v_m_v>
I have one more question
<Regenaxer>
ok
<v_m_v>
why (apply '((N A) (+ N A)) (1 2 3 4))
<v_m_v>
would not work :D
<Regenaxer>
You pass four args, but the function takes only 2
<v_m_v>
hmmm (apply + (1 2 3 4)) is fine but How I can describe the same thing with lambda inside?
<v_m_v>
instead of +
<Regenaxer>
(apply '((A B C D) (+ A B C D))
<Regenaxer>
or (apply '(@ (pass +)) ...
<v_m_v>
oh...but if I don't know how many arguments I have ...
<Regenaxer>
yes
<v_m_v>
oh exactly!
<v_m_v>
I know that @ would be involved
<v_m_v>
!
<v_m_v>
@ means that this is element of iteration and (pass +) ?
<Regenaxer>
I would not say iteration
<v_m_v>
oh?
<Regenaxer>
it evaluates all arguments and remembers the results
<v_m_v>
hmmm PIL is still a mistery for me :D But it is a fun mistery :D
<Regenaxer>
then (next) or (rest) can access them
<v_m_v>
and (pass +)?
<Regenaxer>
or (pass) passes them to another fun
<Regenaxer>
yep
<v_m_v>
WOW!!!
<v_m_v>
Amazing trick
<v_m_v>
Thx
<Regenaxer>
:)
<v_m_v>
BTW the same code in Chicken Scheme (taking and processing data from Postgres) has took me 72 lines of code (without creazy recursions ...just mapping and folding)) the same think in PIL (with your sum) 22 ...
<v_m_v>
I mean I am amazed how small PIL is...
<Regenaxer>
Glad to hear :)
<v_m_v>
I am going to bed. Thx for your help :) Have a good night
<Regenaxer>
Me too. Good night!
v_m_v has quit [Remote host closed the connection]