2021-06-28 12:20:30 siraben: ah, neat; I was watching the OPLSS security-typed-languages lectures the other day, sounds like this is the same thing 2021-06-28 12:42:33 tabemann - regarding aligned word access being atomic on ARM - that's often not the case because of the odd caching model. You MUST use load exclusive followed by store exclusive 2021-06-28 15:17:52 I asked Dan a question about installing avrforth on atmega328P, and he responded by putting a new release on the site with support for 328*, 168p, and 88p: 2021-06-28 15:17:56 http://krue.net/avrforth/ 2021-06-28 15:18:11 I forgot my programmer today, but was planning to try uploading that tomorrow 2021-06-28 17:58:54 maw 2021-06-28 18:11:09 wam 2021-06-28 18:17:44 maw dave0 2021-06-28 18:24:07 super maw io 2021-06-28 18:26:18 maw crc 2021-06-28 18:27:15 what is maw 2021-06-28 18:27:23 like a condensed 'morning'? 2021-06-28 18:33:01 -!- ChanServ changed mode/#forth -> +o mark4 2021-06-28 18:34:24 http://dpaste.com/EJC2J9TKC <-- can anyone here tell me wtf i screwed up in my list management code that makes the directory listing NOT sorted right? 2021-06-28 18:34:32 been banging my head against this wall for 4 days 2021-06-28 18:49:52 mark4: that's not forth code! 2021-06-28 18:50:33 it could be, dave 2021-06-28 18:50:38 you just have to believe 2021-06-28 18:51:40 close enough for government work :) 2021-06-28 18:54:00 mark4: could it be that add_entry cannot put d2 at the head of the list? 2021-06-28 18:54:35 mark4: try adding entries in this order: bbb ccc aaa 2021-06-28 18:54:46 mark4: see if it comes out as aaa bbb ccc 2021-06-28 18:56:09 add_entry seems to be right 2021-06-28 18:56:19 but if its not i cannot see HOW 2021-06-28 18:56:40 i have changed the sense on the sort too 2021-06-28 18:56:43 mark4: readdir() is at the mercy of the underlying filesystem 2021-06-28 18:56:52 it changes the order but it does not result in a sorted list 2021-06-28 18:57:01 if you want the entries ordered by name in any reliable sense, you have to do it yourself 2021-06-28 18:57:32 i am doing it myself 2021-06-28 18:57:45 but dirs and files while kept separate are not properly sorted 2021-06-28 18:57:55 i even wrote a custom version of strcmp to see if somehow there was a bug in that 2021-06-28 18:58:04 mark4: going by your comment on line 222, you always insert n2 /after/ n1, but what if n2 should be the new head of the list? 2021-06-28 18:58:04 highly highly unlikely but i had to test 2021-06-28 18:58:21 thats taken care of 2021-06-28 18:58:49 node_insert() handles the case of an empty list 2021-06-28 18:58:55 so does the append() function 2021-06-28 18:59:20 mark4: no no not an empty list... what if the list already contains bbb ccc and you try to add aaa 2021-06-28 19:00:02 the strcmp should not allow out of order insertions 2021-06-28 19:00:04 thats the problem 2021-06-28 19:00:13 im getting out of order insertions or something 2021-06-28 19:00:50 mark4: first time around the loop in add_entry, n1 points to bbb ... then you compare and aaa should come /before/ n1 ... but there's nowhere in the code to handle that case 2021-06-28 19:01:33 mark4: i think that adding aaa to a list of bbb ccc, your current code would give bbb aaa ccc 2021-06-28 19:01:40 no. n1 points to the head of the list. if the new entry is greater than the current item n1 then we do n1=n1->next 2021-06-28 19:01:50 till the current scanned item is greater than the one were adding 2021-06-28 19:02:03 how? 2021-06-28 19:02:34 oooh! 2021-06-28 19:02:56 if we nave bbb ccc ddd as the lsit and i try to add aaa there is nothing to handle that? 2021-06-28 19:03:11 i.e. the item being added is smaller than the item at the head of the list! 2021-06-28 19:03:12 mark4: i think so 2021-06-28 19:03:18 that might be it! 2021-06-28 19:03:19 mark4: yes :-) 2021-06-28 19:03:29 i haven't tested your code, i just went by inspection 2021-06-28 19:03:54 working in languages without proper repls isnt fun :( 2021-06-28 19:06:11 ok that was def part of it 2021-06-28 19:07:02 eris[m]12: forth's repl is what drew me to forth :-) 2021-06-28 19:07:45 i have only ever used edit-compile-run in c for so many years :-( 2021-06-28 19:07:53 so there must be more than one problem because fixing that only partially fixed the unsortedness 2021-06-28 19:09:49 someone should make a forth for bytepusher. 2021-06-28 19:10:07 a bytepusher? 2021-06-28 19:10:33 https://esolangs.org/wiki/BytePusher 2021-06-28 19:10:34 http://dpaste.com/5LMKVQFC7 2021-06-28 19:10:42 ah! 2021-06-28 19:13:17 mark4: from gdb, it looks like every entry falls through to line 223 where l->head != NULL && n1 == l->head - in other words every entry is being inserted after the first entry of the list, or becomes the first 2021-06-28 19:13:33 ah, this is one of the list of memory addresses 2021-06-28 19:14:00 HOW? WHY? 2021-06-28 19:14:12 thats like saying the string compare is not working 2021-06-28 19:14:23 and if thats the case my rewrite of it failed identically 2021-06-28 19:14:50 you can check this by setting a breakpoint on add_entry and stepping through 2021-06-28 19:17:14 but WHY is it doing that? 2021-06-28 19:17:46 if(cmp <= 0) that if is never true? 2021-06-28 19:17:53 cmp = strcmp(d2->name, d1->name); 2021-06-28 19:18:00 then this call never returns a value <= zero 2021-06-28 19:18:28 consider d1->name is always "." 2021-06-28 19:18:46 it cant be 2021-06-28 19:18:50 that can only happen once :) 2021-06-28 19:19:00 there can never be more than one . in a dir :) 2021-06-28 19:19:53 ah wait, sorry, i screwed up that strcmp line when copying it 2021-06-28 19:20:34 :) 2021-06-28 19:23:41 mark4, did you try printing out the whole list every time you insert something? 2021-06-28 19:26:53 i didnt think of that :) 2021-06-28 19:35:07 ok things are def getting added out of order :( 2021-06-28 19:35:18 http://dpaste.com/4NRS2YAUG 2021-06-28 19:36:58 it def looks like items are being appended onto the end of the list 2021-06-28 19:37:34 which tells me strcmp is returning wrong results but I absolutely do not believe that 2021-06-28 19:49:20 mark4: https://dpaste.com/63DE2X72T 2021-06-28 19:52:53 that doesnt make sense 2021-06-28 19:54:38 output looks correct here though 2021-06-28 19:55:55 yea but i dont understand it 2021-06-28 19:56:51 it IS correect now but i TOTALLY do not understand how you even came up with that or what it is doing 2021-06-28 19:56:58 node_insert(n1, n2); 2021-06-28 19:57:22 n2->payload = d2; 2021-06-28 19:57:27 and it invalidates that line 2021-06-28 19:59:23 how does that work? 2021-06-28 19:59:40 ive been fighting this for 4 days solid 2021-06-28 19:59:48 if cmp < 0, then surely d2->name should come before d1->name? 2021-06-28 20:00:13 you didn't have a node_insert_before, so that payload SWAP is an improvisation to get one 2021-06-28 20:00:17 yea i need to fix my list code to be insert before not insert after 2021-06-28 20:00:21 that was a mistake on my part 2021-06-28 20:09:01 ty :) 2021-06-28 20:09:26 mark4: where can i send the invoice? :) 2021-06-28 20:19:09 to joe biden 2021-06-28 20:19:50 he lives on pensylvania avenye in washington dc :) 2021-06-28 20:19:58 pennsynvania? 2021-06-28 20:20:35 pennsylvania 2021-06-28 20:21:13 ya double n 2021-06-28 20:21:28 1200 i thin but i could be wrong about hta 2021-06-28 20:21:33 1700? i ferget 2021-06-28 20:22:16 1600 2021-06-28 20:24:44 yea 2021-06-28 20:24:53 was too lazy to go look it up heh 2021-06-28 23:53:33 maw