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
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #picolisp
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #picolisp
alexshendi has joined #picolisp
alexshendi has quit [Read error: Connection reset by peer]
cess11 has quit [Ping timeout: 264 seconds]
cess11 has joined #picolisp
pierpal has quit [Quit: Poof]
pierpal has joined #picolisp
mtsd has joined #picolisp
<mtsd> Good mot
<mtsd> *morning*
<mtsd> fingers stumbling on the keyboard :)
<Regenaxer> Good morning mtsd :)
pierpal has quit [Ping timeout: 264 seconds]
rob_w has joined #picolisp
mtsd has quit [Quit: leaving]
rob_w has quit [Read error: Connection reset by peer]
rob_w has joined #picolisp
pchrist has quit [Quit: leaving]
pchrist has joined #picolisp
rob_w has quit [Quit: Leaving]
andyjpb has joined #picolisp
rob_w has joined #picolisp
pierpal has joined #picolisp
pierpal has quit [Client Quit]
pierpal has joined #picolisp
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #picolisp
pierpal has quit [Quit: Poof]
pierpal has joined #picolisp
pierpal has quit [Quit: Poof]
pierpal has joined #picolisp
andyjpb has quit [Ping timeout: 260 seconds]
andyjpb has joined #picolisp
_whitelogger has joined #picolisp
stultulo has joined #picolisp
f8l has quit [Ping timeout: 265 seconds]
stultulo is now known as f8l
freeemint has joined #picolisp
rob_w has quit [Quit: Leaving]
alexshendi has joined #picolisp
<freeemint> Is there a mapcar in destructive which returns the result also
<Regenaxer> mapcon or mapcan?
<freeemint> ? (mapcar '((X) (mapcar 'val X)) '((+ - &) (car cdr)))
<freeemint> ? (mapcan '((X) (mapcan 'val X)) '((+ - &) (car cdr)))
<freeemint> -> (+ - & . (car cdr .))
<freeemint> ? (mapcon '((X) (mapcon 'val X)) '((+ - &) (car cdr)))
<freeemint> -> ((270182 270192 270333) (268653 268656))
<freeemint> -> NIL
<freeemint> I am doing some stuff with very many variables which i fill in to a matrix
<freeemint> getting another copy is bad but i am not happy with it
<Regenaxer> mapcon is like maplist (taking the restlists), just destructive
<Regenaxer> mapcan is the destructive version of mapcar
<Regenaxer> 6 functions
<freeemint> why does mapcan yield nil then?
<Regenaxer> (mapcan 'val X) X is not a list
<Regenaxer> mapcan iterates over the successive CDRs of a list
<Regenaxer> What do you want to do?
<Regenaxer> I suggest you single-step to see what goes on
<Regenaxer> Hard to explain otherwise
<freeemint> where would you place the ! ?
<Regenaxer> BTW, the function does not need to be quoted here
<Regenaxer> (mapcar val ...
<freeemint> I know but i find it more logical if i do that
<Regenaxer> Why is quoting logical
<Regenaxer> It has to be undone by the interpreter
<Regenaxer> What do you want to do?
<freeemint> Yes but it is esier t think for me
<Regenaxer> The *function* is not the symbol 'val'
<Regenaxer> but a number or a list
<freeemint> I explain it in one dimension but i want to do it in 2
<Regenaxer> Did you look at the rosetta matrix examples?
<Regenaxer> they usually do (apply mapcar etc
<freeemint> I can guarantee you it is not what i want to do
<Regenaxer> What do you want to do?
<freeemint> I want to create all nxn matrixes filled with every permutation of elements from a list.
<Regenaxer> What do you want to do?
alexshendi has quit [Read error: Connection reset by peer]
<freeemint> A build a function which buils me an function for n by n and the list
<Regenaxer> ok
<freeemint> i can send you a small output so you see the result
<Regenaxer> sorry, no, busy now
<freeemint> Your time , but you get the idea in a few seconds
<Regenaxer> No, I just can answer questions about the mapping funs
<freeemint> (if you choose to invest it)
alexshendi has joined #picolisp
<freeemint> i think i might found one mistake
<Regenaxer> greats
<freeemint> oh now i got a core dump
<Regenaxer> ;)
<Regenaxer> btw, the ! can be placed anywhere you want to look at the env
<freeemint> i know
<freeemint> i got the feeling that mapcan flattens stuff
<Regenaxer> I would not say so. It passes each element to the function, and *concatenates* the results
<Regenaxer> so the results should be "fresh" lists
<Regenaxer> because conc is destructive
<freeemint> ok that is not what i understand under destructive
<freeemint> but that description explains what i see
<Regenaxer> : (mapcan '((N) (list (inc N))) (1 2 3))
<Regenaxer> -> (2 3 4)
<Regenaxer> same as (mapcar inc ...
<Regenaxer> With 'mapcon' you can eemulate all other mapXXXs
<Regenaxer> and also filter, extract etc
<freeemint> how can i see the free cell count?
<Regenaxer> : (mapcon '((L) (list (inc (car L)))) (1 2 3))
<Regenaxer> -> (2 3 4)
<Regenaxer> IIRC there is none
<Regenaxer> only the number of heaps
<freeemint> how can i compare cell usage by function?
<freeemint> as in which uses more
<Regenaxer> (size fun) gives the number of cells
<Regenaxer> of the function, not of the output
<freeemint> the number cells used during the execution and for the result
<Regenaxer> What you need for that is the number of 'cons' calls
<freeemint> (or conc?)
<Regenaxer> With "used" you mean "taken from the avail list"?
<freeemint> yes
<Regenaxer> no, conc uses no new cell
<freeemint> ok
<Regenaxer> cons, list, mapcar etc
<freeemint> free cell count = lenght of avail list
<freeemint> is there some way to meassure?
<Regenaxer> yes, but it grows as needed
<Regenaxer> no way to measure on the Lisp level
<Regenaxer> Why do you want to measure?
<Regenaxer> You can count the cons calls
<Regenaxer> list, link mostly
<freeemint> hpw can count the cons calls?
<Regenaxer> mapcar produces exactly the number of cells of the arg list
<Regenaxer> By looking at the code
<freeemint> manually?
<Regenaxer> With logic thinking
<Regenaxer> mapcar produces exactly the number of cells of the arg list
<freeemint> that is the problem i want to verify my counting
<freeemint> yes
<Regenaxer> cons produces 1
<Regenaxer> Hmm, you can 'size' the result perhaps
<Regenaxer> But no, some might be garbage
<Regenaxer> There is no trivial way
<Regenaxer> Why are you concerned about that?
<freeemint> there is one trivial way. but i can not do it,
<Regenaxer> Patch the cons functions?
<freeemint> count the lenght of the avail list ... it is not time critical
<Regenaxer> Not trivial
grp has joined #picolisp
<Regenaxer> No, the avail list makes no sense
<freeemint> pathing count would be more elegant
<Regenaxer> it grows, and many cells used might be garbage collected in between
<freeemint> *cons
<Regenaxer> I think this measuring is useless
<freeemint> ok give me away to stop gc
<Regenaxer> No need to worry
<freeemint> and i preallocate enough before hand
<freeemint> *or i prealloc
<Regenaxer> Why are you concerned about that?
<Regenaxer> Why are you concerned about that?
<Regenaxer> Why are you concerned about that?
<Regenaxer> Premature optimization?
<freeemint> 1. because i want to verify my counting
<freeemint> 2. because it might make for a good hotspotting tool
<freeemint> 3. because the programm i write (all matrics of nxn filled by symbols from a list) puts lost of stress on the gc for sure and i want to minimize it as an exercise
<freeemint> 4. premature optimization and picolisp beiing my vreative outlet
<freeemint> does that help
<Regenaxer> OK. You can always write a program with *no* consing (except for I/O) when you pre-allocate all structures and operate on them destructively
<Regenaxer> (map set ...
<freeemint> if i preallocate the structure the universe might die
<Regenaxer> yeah
<freeemint> I wantd to turn it in to a job once i got it running
<Regenaxer> What kind of job?
<freeemint> 'job
<freeemint> :P
<Regenaxer> in the sense of project, or 'job' function?
<Regenaxer> ok
<freeemint> job function
<freeemint> sorr to disappoint
<freeemint> (i am not use to the new keyboard yet)
<Regenaxer> No problem, I have enough (or too many) jobs currently
<Regenaxer> Back to the above: To count the 'cons' operations, you can modify all whe functions in src64/gc.l
<freeemint> Have you thought about getting paid a little to extend picolisp as people wish? (no arrays)
<Regenaxer> all "cons" funs
<Regenaxer> haha, good
<Regenaxer> (no arrays)
<Regenaxer> No, I do it for free
<Regenaxer> But only if it is a good idea
<freeemint> Of course
<Regenaxer> There are many functions of the form 'consE_C'
<Regenaxer> Only here consing is done
<Regenaxer> only in src64/gc.l
<freeemint> But that way i might stop idle musing when a price is attahed to every hour of wokr a people settle for the minimum necessary change to pil
<Regenaxer> Even a small change will introduce a lot of trouble in the long range
<Regenaxer> must be maintained
<Regenaxer> splits the versions
<freeemint> *But that way i might stop request of you when a price is attachd to every hour of your work and people in general settle for the minimum necessary change
<Regenaxer> documented, discussed
<freeemint> no version split one rolling release
<freeemint> i would prefer
<Regenaxer> yes
<Regenaxer> Best is if you hack it according to your needs
<freeemint> I do not like that idea. It is very suboptimal from a global perspective and might fracture the community
<freeemint> Just imagine how many functions will be reinvented because the existing ones are not properly understood. And -icolisp source code will become incompatible when some patches are only implemented in one interpreter
<freeemint> that is lovecraftian cosmic horror to my ears
karswell_ has joined #picolisp
<Regenaxer> So the best is to write such extensions outside the core system
<Regenaxer> eg a shared object file
<Regenaxer> You could really try
<Regenaxer> For example, a function counting all *used* cells would be simple
<Regenaxer> 'heap' does something similar
<Regenaxer> But I think the returned count is not useful
<Regenaxer> The used cells change all the time rather unpredictably
<freeemint> Well normally you say implement it and see if it is usefull (fast enough or so) but i understand that the core language is another deal
karswell_ is now known as karswell
<Regenaxer> I think the possibility to write .so libs in pil is an underused (also by me) feature
<Regenaxer> only 'ext' and 'ht'
<Regenaxer> It is not so very simple though
<Regenaxer> (writing a .so)
<Regenaxer> needs asm
<Regenaxer> Easier in arm64 than in x86 iirc
<Regenaxer> cause the x86 asm version does not fully support pos. independent code
<Regenaxer> and that is needed in .so libs
<Regenaxer> (This is the reason the base system was never ported to PIC coding)
<Regenaxer> (only a subset for the libs)
<Regenaxer> But on arm64, ppc64 or emu this is not an issue
<freeemint> I only got x86, my server runs x86 ... so that is a bummer
<Regenaxer> Well, still possible
<Regenaxer> as in 'ext' and 'ht'
<freeemint> The .so idea is maybe under utilized because nobody really knows how to connect asm to
<Regenaxer> I don't remember, some addressing modes don't work
<Regenaxer> Yes, right
<freeemint> ext and ht are quiet limited in terms of parameters if i recall
<Regenaxer> Not in parameters I think
<freeemint> Ok, i am not that well versed on the native front
freeemint has quit [Ping timeout: 265 seconds]
freeemint has joined #picolisp
freeemint has quit [Client Quit]
pierpal has quit [Quit: Poof]
pierpal has joined #picolisp
styx has joined #picolisp
pierpal has quit [Ping timeout: 240 seconds]
styx has quit [Quit: styx]
orivej has quit [Ping timeout: 256 seconds]
pierpal has joined #picolisp
pierpal has quit [Client Quit]
pierpal has joined #picolisp
pierpal has quit [Ping timeout: 256 seconds]
grp has quit [Quit: box shutting down...]
pierpa has joined #picolisp
pierpal has joined #picolisp
alexshendi has quit [Ping timeout: 245 seconds]
alexshendi has joined #picolisp