tag:blogger.com,1999:blog-1720439865889190419.post8698500603372858398..comments2023-03-25T13:51:50.278+01:00Comments on C Spangled: Linked lists in JSONAlberthttp://www.blogger.com/profile/15599692262672037932noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-1720439865889190419.post-49528365740381174452012-10-02T17:30:05.721+02:002012-10-02T17:30:05.721+02:00Hi Doug! Glad to see my post could be of inspirat...Hi Doug! Glad to see my post could be of inspiration to you!<br /><br />As an open source coder, nothing makes me more happy than to see other people expanding on and improving my code.<br /><br />Doubly linked lists sound like a great idea, but I'm a bit unsure about how this would affect the operational efficiency as it's using a dict for recursion-restriction lookup.<br /><br />I'll be sure to try it out and see how it goes. This could be a good excuse as any to start writing a JavaScript profiler. :)Alberthttps://www.blogger.com/profile/15599692262672037932noreply@blogger.comtag:blogger.com,1999:blog-1720439865889190419.post-8575432234434795672012-10-02T17:15:55.030+02:002012-10-02T17:15:55.030+02:00helo i have improved yr implumantashon with making...helo i have improved yr implumantashon with making it as a dubaly linked list. i think it works maybe<br /><br />Array.prototype.toJSONll = (function() {<br /> var SUPER_DATABASE_OF_VALYEWS = [];<br /> var USE_OF_VALYEWS = 0;<br /> function CURRANT_VALYEWS() { <br /> return SUPER_DATABASE_OF_VALYEWS[USE_OF_VALYEWS];<br /> }<br /> return function (idx) {<br /> idx = idx || 0;<br /> if (idx >= this.length) return "null";<br /> idxS = idx.toString();<br /> valueS = JSON.stringify(this[idx]);<br /> nextS = this.toJSONll(idx + 1);<br /> idx !== 0 && !this[idx-1].next && CURRANT_VALYEWS()[this[idx-1]] ? (prev = this.toJSONll(idx - 1)) : (prev = "");<br /> return ("{idx: " + idxS +<br /> ", value: " + valueS +<br /> ", prev: " + (prev ? prev : "") +<br /> ", next: " + nextS + "}");<br /> var idxS = null;<br /> var valueS = null;<br /> var nextS = null;<br /> };<br />})()Douglas Crockfordhttp://www.json.orgnoreply@blogger.comtag:blogger.com,1999:blog-1720439865889190419.post-67258512091210542422012-01-27T16:04:53.227+01:002012-01-27T16:04:53.227+01:00This is brilliant, but not up to the same standard...This is brilliant, but not up to the same standard as your postings of yesteryear. You had a fantastic streak of posts. My favorites were the c# memory management series, the job interview, and the post about management. It's rare that you get a view of the profession from so many angles and with such professionalism. I hope you have a few more in depth posts in store for 2012!paintcannoreply@blogger.comtag:blogger.com,1999:blog-1720439865889190419.post-61565510275331013042011-09-29T18:08:41.103+02:002011-09-29T18:08:41.103+02:00You have to traverse down your objects like normal...You have to traverse down your objects like normal to find the id when you want to delete something, which shouldn't be necessary.<br /><br />so<br />obj(3).next = obj(4).next<br /><br />becomes (over iteration)<br />obj.obj.obj.next() = obj.obj.obj.obj.next()Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1720439865889190419.post-73063728026119276332011-09-08T23:21:14.670+02:002011-09-08T23:21:14.670+02:00Thank you for posting this. JSON/Javascript is an ...Thank you for posting this. JSON/Javascript is an important part of the modern coder's toolkit, and lots of coders don't pay a sufficient mind to the efficiency properties of their toolbelt contents! Glad to see that someone is planting that flag.Tomnoreply@blogger.com