tag:blogger.com,1999:blog-5554915078212081470.post6210857608048763109..comments2008-03-06T18:06:55.959-06:00Comments on HiR Information Report: IP Subnetting - more fun with newLISPAx0nhttp://www.blogger.com/profile/12145109647562469601noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-5554915078212081470.post-16733253130984062572008-03-06T18:06:00.000-06:002008-03-06T18:06:00.000-06:00... at least on Mac OS X the integer % -operator s...... at least on Mac OS X the integer % -operator seems to be fasterAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-5554915078212081470.post-37300412618028113562008-03-05T02:53:00.000-06:002008-03-05T02:53:00.000-06:00Nice work!A tiny amount of repetition could be avo...Nice work!<BR/><BR/>A tiny amount of repetition could be avoided:<BR/><BR/>(define (iptostr1 ip4)<BR/># Converts an integer to an IP in dotted decimal notation<BR/>(join (map (fn (x) (string (% (/ ip4 x) 0x100))) '(0x1000000 0x10000 0x100 1)) "."))<BR/><BR/>but I quite like the layout of your longer version. <BR/><BR/>To match "/", use "%". "mod" is floating-point. (Although it might be quicker... :)newlisperhttp://unbalanced-parentheses.nfshost.com/index.cginoreply@blogger.com