IRC channel logs
2020-12-27.log
back to list of logs
<daviid>ruffni: here it failed with a 1020 error (iirc - I run tor with a few extensions, no-script did block one or more script(s) on that page ... I had to restart tor since and now it worked - no idea why, but debian and gnome are much better services, no script, no tracking, no none free js ... and, last but not least, they have a 'scheme' language renderer ... <daviid>ruffni: anyway, others did help i see ... <daviid>ruffni: the snipset you pasted is incomplete, your code already triggers error compiing, then you do not shoe the class intantiation, nor the method call, and did not pste the error either .. :):) <spk121>civodul: what's the best strategy for making patches to Guile happen these days? <daviid>ruffni: to much to guess :) - no pun, but I kindely invite you to write complete, smallest possible 'self contained' examples, so one can copy/paste(drop in a tmp file, compile/execute and reproduce the error ... <daviid>adapt, ask for help otherwise ...) <fnstudio>hi :) if created with make-vector or vector-copy, a vector seems to be modifiable at a later stage; if created with `#(0 1 2 ...)` however, it seems it can't be modified? <fnstudio>i've tested this with vector-move-left!, for example <fnstudio>if i try to "move-left" onto a #()-created vector, i get "Wrong type (expecting mutable vector)" <fnstudio>things seem to work as expected (as *i* expected :)), if trying with a "make-vector-created" vector <RhodiumToad>yes, literal things constructed by the reader are not supposed to be mutable <leoprikler>it should also work if you create your vector using (vector ) <RhodiumToad>that should work too, (vector ...) is like (list ...) in that it returns a new object <fnstudio>RhodiumToad: i see, that makes sense (well, not yet completely as i still need to wrap my head around these details, but i think i'll get there) <chrislck>IIRC there are optimization opportunities but I'm likely wrong <RhodiumToad>because if they were mutable then it would be weird to have the program scribbling on its own literals <chrislck>the lack of vector search api means it's probably the wrong data structure to use <RhodiumToad>though that doesn't necessarily make it the right data structure. <fnstudio>chrislck RhodiumToad: very interesting... yes i was just wondering whether i should use a vector or a list or a hashtable <fnstudio>and i thought of trying and familiarising myself with vectors a little bit <fnstudio>i need a data-structure to handle 10 numbers (actually 0-9) and to modify it and iterate on it <fnstudio>i suppose everything would do, as it doesn't seem to be a very resource intensive exercise <fnstudio>but i wanted to take it as an opportunity to use the most suited structure <chrislck>for 10 agree any is ok; vector is simplest <fnstudio>chrislck RhodiumToad: cool, tx! i'll give it a try with vectors plus SRFI-43 then *chrislck waits to hear of AOC D24 whereas 10 numbers get upgraded to 10,000 numbers... <fnstudio>that's exactly my feeling when starting this kind of exercises... especially AOC where exercises always come in two parts... i always brace for the intractable part coming in the second half lol <surpador>fnstudio: for what it's worth, I did that one with a circular list, and it worked really well <surpador>Especially for the second part, you might need the linked list representation :) <surpador>Also, any chance you have your solutions posted somewhere? I've been trying to find someone else who's doing them in Guile Scheme to conpare solutions with <fnstudio>surpador: i'm very much a beginner but i'd be very glad to share them with you and exchange some feedback/ideas <fnstudio>surpador: if you tend to hang out here pretty regularly i could send you a follow up / DM you once i've put them somewhere online <surpador>fnstudio: that sounds great! Yep, I'm on here pretty regularly just lurking :) <surpador>I'm just learning too so should be useful for both of us! <fnstudio>surpador: excellent, thanks! i'll try and put things online asap <fnstudio>i don't seem to be able to find min / max "built-in" procedures <fnstudio>i suppose it's therefore a matter of sorting + car? <RhodiumToad>(max ...) and (min ...) work at least for numbers, I think? <fnstudio>ok, then i must have done something wrong... hm <surpador>Yeah, should be like (apply max list) I think <fnstudio>RhodiumToad: sure, thanks for mentioning that - luckily it was for another part of the exercise <fnstudio>is there any substantial differnece between take (from SRFI-1) and list-head, or is it just the name? <civodul>fnstudio: it's just the name, and also 'list-head' is implemented in C so it might be slightly slower