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
razzy has joined #picolisp
orivej has quit [Ping timeout: 258 seconds]
rob_w_ has joined #picolisp
rob_w has quit [Ping timeout: 240 seconds]
viaken has quit [Quit: reboot]
viaken has joined #picolisp
aw- has quit [Ping timeout: 246 seconds]
aw- has joined #picolisp
m_mans has joined #picolisp
m_mans has quit [Quit: Leaving.]
_whitelogger has joined #picolisp
xkapastel has quit [Quit: Connection closed for inactivity]
_whitelogger_ has joined #picolisp
_whitelogger has quit [Remote host closed the connection]
_whitelogger has joined #picolisp
orivej has joined #picolisp
Regenaxer has left #picolisp [#picolisp]
Regenaxer has joined #picolisp
<Regenaxer> Cool, PicoLisp 18.12.27 is now in Debian Sid! So I can write 日本語の漢字 here 💪
<Regenaxer> (because my irc client uses the normal pil repl line editor)
m_mans has joined #picolisp
m_mans has quit [Ping timeout: 268 seconds]
alexshendi has joined #picolisp
<alexshendi> Good morning.
<Regenaxer> Good morning alexshendi
_whitelogger has joined #picolisp
<Regenaxer> alexshendi, there are quite a lot of tasks in rosetta handling bitmaps
<Regenaxer> The ones I wrote and can find in my old files are:
<Regenaxer> Bitmap
m_mans has joined #picolisp
<Regenaxer> Bitmap/Bitmap/Bézier curves/Cubic
<Regenaxer> Bitmap/Bitmap/Bézier curves/Quadratic
<Regenaxer> Bitmap/Flood fill
<Regenaxer> Bitmap/Bresenham's line algorithm
<Regenaxer> Bitmap/Histogram
<Regenaxer> Bitmap/Midpoint circle algorithm
<Regenaxer> Bitmap/PPM conversion through a pipe
<Regenaxer> Bitmap/Read a PPM file
<Regenaxer> Bitmap/Read an image through a pipe
<Regenaxer> Bitmap/Write a PPM file
<Regenaxer> So it seems you can find almost everything
<Regenaxer> You use 4 list elements per pixel, I used a sublist
<Regenaxer> 3 elements for R, G, B
<alexshendi> Regenaxer: Thanks for the input.
<Regenaxer> :)
<alexshendi> There I can also see the correct indentation.
<Regenaxer> T
<Regenaxer> There are always many ways to implement such things
<Regenaxer> Often 'make' is better than the mapping functions
<Regenaxer> eg in makeEmptyBitmap, instead of (mapcar '((X) (need (* 4 W) 0)) (need H 0)))
<Regenaxer> I would do
<Regenaxer> (make
<Regenaxer> (do H
<Regenaxer> (link (need (* 4 W) 0)) ) ) )
<Regenaxer> (need H 0) creates a list which is thrown away immediately
<Regenaxer> Concerning the formatting, the best is to look at the output of 'pp'
<Regenaxer> Wow, strong snowfall started
orivej has quit [Ping timeout: 250 seconds]
orivej has joined #picolisp
<Regenaxer> Must go out and shovel snow :(
<alexshendi> OK, thanks for all the info.
<Regenaxer> ret
<Regenaxer> np :)
m_mans has quit [Quit: Leaving.]
orivej has quit [Ping timeout: 258 seconds]
<razzy> good morning
<Regenaxer> Hi razzy
alexshendi has quit [Ping timeout: 240 seconds]
rob_w_ has quit [Quit: Leaving]
rob_w has joined #picolisp
orivej has joined #picolisp
orivej has quit [Ping timeout: 258 seconds]
<beneroth> Good morning Regenaxer, razzy
_whitelogger has joined #picolisp
<Regenaxer> Hi beneroth
<Regenaxer> beneroth, back in Winterthur? Lots of snow?
<Regenaxer> I was out now four times shoveling
<Regenaxer> now it seems to stop
Viaken[m] has quit [Remote host closed the connection]
<beneroth> yeah I'm in Winterthur, and it snowed over night, still snowing now.
<beneroth> not really needed yet to shovel, but probably soon if it continues like this. streets are white now.
<beneroth> I like it :)
<razzy> beneroth: if you are visiting there, there is wonderfull technical museum
<razzy> on second thought, you propably live there and know alright :]
<beneroth> yep, second
Viaken[m] has joined #picolisp
<razzy> the museum impressed me and made deep feelings i want to communicate.
orivej has joined #picolisp
alexshendi has joined #picolisp
<alexshendi> ret
abel-normand has joined #picolisp
alexshendi has quit [Read error: Connection reset by peer]
<razzy> hm, i recall there was function that searched property lists and return symbol that has some property.
<Regenaxer> a reverse search? Not specially for properties
<Regenaxer> you can use 'assoc' though
alexshendi has joined #picolisp
<razzy> ah, can is little similiar
<Regenaxer> well, but methods are not stored in properties
<razzy> yeah, "tiny" flaw in plan :]
<Regenaxer> How is your plan?
<razzy> what do you mean?
<Regenaxer> Your plan which you said is flawed
<razzy> i will try to obtain all symbols property lists and than return symbols with said property
<Regenaxer> ok
<razzy> which seem usefull funstion to have
<Regenaxer> indeed similar to 'can' in some way
<razzy> how to obtain all symbols?
<razzy> in memory?
<Regenaxer> (all)
<Regenaxer> As you said, like 'can' does ;)
<razzy> thx, it would take me while to find
xkapastel has joined #picolisp
<beneroth> recommendation for programmers: easy/simple good explanation of Spectre and the general issue of CPU/memory side-channel attacks: https://media.ccc.de/v/35c3-9893-a_christmas_carol_-_the_spectres_of_the_past_present_and_futur
<beneroth> with Spectre-variant lyrics christmas song
<Regenaxer> missing 'e'
<Regenaxer> future
<Regenaxer> Did you enjoy CCC?
<beneroth> yeah, though I was only in like 3 talks or so.. mostly spend time with technical and philosophical discussions with friends and random people, "angeling" (helping out, the whole congress is operated bys voluntary work of ca. 10% of the visitors)
<Regenaxer> Nice
<beneroth> I love the atmosphere there, interesting curious intelligent people having to tell and show interesting stuff (and they usually being interested in whatever others have to tell and show)
<Regenaxer> ok
<Regenaxer> I'm too lazy ;)
<Regenaxer> should also visit more such happenings
<beneroth> and everything just runs smooth. also a big feature of everything being run by volunteers, that way people are motivated, glad to help (they want to make others enjoy the congress), and often skilled people with professional background
<beneroth> you definitely should visit C3 once. its quite a different thing that a sales mass, training congress or pure programmer meetup (like fosdem, and I imagine froscon).
<Regenaxer> yeah
<beneroth> there are many art installations, like one bar had a piano on strings hanging from the ceiling above it, on strings, taken apart like an "explosion-drawing"? (I'm unsure about the word)
<Regenaxer> me too, in German it is that
<beneroth> and a few mechanical robots. one is a weird creepy looking dog-thingy based on pneumatics and arduino control. the owner put the C API on the floor with the marker, people could write a program to be loaded on the robot, so it did something different all the time
<beneroth> a lot crazy fun stuff :)
<Regenaxer> cool
<alexshendi> Hi, beneroth
orivej has quit [Ping timeout: 250 seconds]
orivej has joined #picolisp
alexshendi has quit [Ping timeout: 250 seconds]
alexshendi has joined #picolisp
<alexshendi> Re
<razzy> how pricey is if you look for properties with (prop 'sym 'property ) ? it generates (NIL . property) for every symbol i ask
<beneroth> see (size)
<beneroth> e.g. (size '(NIL . property))
<razzy> thx
<beneroth> and if you don't pre-allocate memory with (gc 'num) (gc with number argument) high number of allocations tend to become costly, as then every time the so-far allocated memory is filled, garbage collector gets executed and than additional memory allocated (if still needed)
<Regenaxer> razzy, you misunderstand this
<Regenaxer> 'prop' does not *generate* anything
<Regenaxer> correct what beneroth says for general consing
<Regenaxer> but 'prop' is an access function like 'get'
<razzy> Regenaxer: it seems, picolisp says something different. https://ptpb.pw/HTsi (prop) seem to generate (NIL . prop) pair when (get do not)
<Regenaxer> What does picolisp "say" here?
<Regenaxer> The reference for 'prop' *says*: Fetches a property for a property ...
<Regenaxer> It does *not* build anything
<beneroth> thx Regenaxer. I didn't look at ref.
<razzy> when i use (show 'a) afterwards, it show (NIL . h) property (prop) created
<Regenaxer> razzy, have you understood the mechanisms of properties in pil?
<razzy> Regenaxer: i think so
<Regenaxer> look at doc64/structures
<Regenaxer> Why should it cons a cell which it just looked up?
<Regenaxer> +-----+-----+ +-----+-----+ +-----+--+--+
<Regenaxer> | | | ---+---> | KEY | ---+---> | | | | |
<Regenaxer> +--+--+-----+ +-----+-----+ +--+--+-----+
<Regenaxer> | |
<Regenaxer> V V
<Regenaxer> +-----+-----+ +-----+-----+
<Regenaxer> | VAL | KEY | | VAL | KEY |
<Regenaxer> +-----+-----+ +-----+-----+
<Regenaxer> 'prop' is almost the same as 'get'
<Regenaxer> it finds KEY
<Regenaxer> but instead of returning VAL it returns the whole cell
<Regenaxer> that's all. No consing involved
<Regenaxer> It is important that it does *not* cons a new cell
<razzy> Regenaxer: i want what you said to be true. but it seems that (prop) is consing (NIL . property) pair of the property it looks for.
<Regenaxer> So you can (inc (prop 'A 'a)) or (pop (prop 'A 'a))
<Regenaxer> I *know* it is true
<Regenaxer> (at least last week I remember it was still true)
<razzy> Regenaxer: pls look at this it is a bit redacted for better show https://ptpb.pw/ThdV
<Regenaxer> I know what you mean. If the cell does *not* exist yet, it is created
<Regenaxer> So this allows (push (prop 'a 'b) 1
<Regenaxer> )
<razzy> i see now.
<Regenaxer> Otherwise 'push' would crash
<Regenaxer> (push NIL 1)
<razzy> i would of liked to use existence of property for searching
<razzy> nevermind
<Regenaxer> yeah, a property kind of always exists
<Regenaxer> you can test for this existence with 'getl'
<Regenaxer> 'get' or 'prop' always succeed
<Regenaxer> though 'get' never creates a NIL property
<Regenaxer> and 'put' completely removes the cell if the value is NIL
<razzy> interesting
<Regenaxer> So in summary, you were not completely wrong, because 'prop' does a cons in a certain situation (ie. the first time). But this is not "pricey"
<razzy> well, i intend search (all) so imagine every symbol with added cell
<razzy> propably more :]
<razzy> thx
<Regenaxer> With "with added cell" you mean those with properties?
<Regenaxer> Perhaps the best is to iterate (all) with 'maps'
<Regenaxer> 'getl' is more costly, as it builds the list each time
<Regenaxer> (getl 'A) is about the same as (make (maps link 'A))
<razzy> case closed. i will optimize later :]
<Regenaxer> good
alexshendi has quit [Read error: Connection reset by peer]
alexshendi has joined #picolisp
alexshendi2 has joined #picolisp
alexshendi has quit [Ping timeout: 264 seconds]
<razzy> i still have troubles figuring out where to put quotes
<Regenaxer> Well, only if you want to inhibit evaluation of something
alexshendi2 has quit [Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org]
alexshendi has joined #picolisp
<tankf33der> i've implement this
<Regenaxer> Interesting!
<razzy> if somebody like function that fetches symbols with defined property not very efficient function https://ptpb.pw/cEUn
<Regenaxer> razzy, good
<Regenaxer> 'filter' is a little easier than 'extract'
<Regenaxer> no 'when' needed
<Regenaxer> but as 'getl' produces garbage, 'maps' might be better
<Regenaxer> but more tediols
<Regenaxer> tedious
<razzy> thx for feedback
<Regenaxer> but if you don't care about the NIL properties, a simple 'get' is best
<razzy> i might care
<Regenaxer> (filter '((Y) (get Sym Y)) Lst)
<Regenaxer> In which case would you care?
<Regenaxer> The propery is logically empty, non-existing
<Regenaxer> In case of external symbols, they aren't even written to the DB
<Regenaxer> hmm, not sure now
<Regenaxer> forget that
<Regenaxer> Properties with a *key* of NIL are not written
<Regenaxer> "volatile" property
<Regenaxer> nevermind
<Regenaxer> tankf33der: How did you get the idea to implement Summed Area Tables?
<razzy> i was thinking that existence of property cell could be used as binary statement. "could this symbol have this propery"?
<tankf33der> Regenaxer: adventofcode task
<Regenaxer> razzy, I would not rely on it
<tankf33der> im on day 11
<Regenaxer> the cell is only created spuriously
<Regenaxer> tankf33der, I see, great
<razzy> Regenaxer: thx for explanation, that NIL properties are unreliable. it would of driven me mad
<razzy> i mean, more mad
<Regenaxer> hehe
<Regenaxer> unreliable is not the right term
<razzy> i think it is reasonable
<Regenaxer> But NIL simply means "no value" here
<razzy> some functions destroy them
<Regenaxer> Looks good
<tankf33der> warmup example from wikipedia, will integrate to adventofcode lately. Feel no energy.
<Regenaxer> :)
<beneroth> tankf33der, nice
<beneroth> Regenaxer, boolean fields are stored as properties without a value in DB, afaik. if the boolean value is NIL, not even the property name is stored.
<beneroth> just a minor detail. not relevant for razzy. nice minor optimization for db case.
<beneroth> tankf33der, thanks for pointing me at this, I didn't know this. might be useful for speeding up a number crunching database.
ubLIX has joined #picolisp
<Regenaxer> beneroth, right
ubLIX has quit [Quit: *cackles*]
jibanes has quit [Ping timeout: 250 seconds]
jibanes has joined #picolisp