tag:blogger.com,1999:blog-2815828321449176550.post6365567139708511471..comments2015-08-01T05:14:01.613+02:00Comments on lower case: flattened...Andreas Zeidlerhttp://www.blogger.com/profile/16660780388046529841noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-2815828321449176550.post-32130095402016185292015-08-01T05:14:01.613+02:002015-08-01T05:14:01.613+02:00Pikachu Games: play all Mr Bean Games online from ...<a href="http://www.pikachugames.net//" rel="nofollow">Pikachu Games</a>: play all Mr Bean Games online from MrBeanGamesOnline.com. Our site have new Mr Bean Games for you.Anonymoushttps://www.blogger.com/profile/12193879322533670744noreply@blogger.comtag:blogger.com,1999:blog-2815828321449176550.post-34180750297088778182009-04-15T01:14:00.000+02:002009-04-15T01:14:00.000+02:00Sorry I missed your first comment on my blog. It s...Sorry I missed your first comment on my blog. It seems your version is indeed slightly faster; however, since it doesn't preserve insertion order, and doesn't work with the case mentioned by stephan above, I'm not going to update my post to use your version just yet. If you get those issues fixed I'd be glad to recommend using your version.<br /><br />Ps. You're only flattening "a" once in your benchmark; the rest of the runs get an already flattened "a".MonkeeSagehttps://www.blogger.com/profile/01905033551465108847noreply@blogger.comtag:blogger.com,1999:blog-2815828321449176550.post-5612340444515890692009-02-02T03:03:00.000+01:002009-02-02T03:03:00.000+01:00the second version also doesn't flatten the sequen...the second version also doesn't flatten the sequence if the input is i.e. [[5, [6]], 7, [8]]. The function can be fixed to work correctly, but is (at least in my tests) slower than fletchers version. I also think it's generally not a good idea to change the sequence that you are iterating over.Stephan Altmuellerhttps://www.blogger.com/profile/09332165261028449183noreply@blogger.comtag:blogger.com,1999:blog-2815828321449176550.post-3852418348466351622009-01-26T16:55:00.000+01:002009-01-26T16:55:00.000+01:00@mj: you're right, it's borked! :) the fixed vers...@mj: you're right, it's borked! :) the fixed version is only slightly different, though, but gets the order slightly wrong (still)...Andreas Zeidlerhttps://www.blogger.com/profile/16660780388046529841noreply@blogger.comtag:blogger.com,1999:blog-2815828321449176550.post-11489719612647123242009-01-26T12:46:00.000+01:002009-01-26T12:46:00.000+01:00So what happens when you flatten a list with non-n...So what happens when you flatten a list with non-nested elements at the start with your version? Without testing, just reading the code, I suspect your version will loose items, because n doesn't actually point to the correct index for the item about to be un-flattened in that case..Martijn Pietershttps://www.blogger.com/profile/03079128955763940434noreply@blogger.com