tag:blogger.com,1999:blog-12467669.post1332081194253589403..comments2023-04-29T07:23:25.825-04:00Comments on Jay Fields' Thoughts: Clojure: Flatten KeysJayhttp://www.blogger.com/profile/14491442812573747680noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-12467669.post-80318655645000797532012-05-10T15:48:18.828-04:002012-05-10T15:48:18.828-04:00this works well, the only adjustment i made was to...this works well, the only adjustment i made was to check for empty maps -- so something like <br /><br />(if (and (map? m) (not (empty? m))) ... )Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-12467669.post-88295250885923133172012-05-10T15:47:24.619-04:002012-05-10T15:47:24.619-04:00this works really well -- the only adjustment i ma...this works really well -- the only adjustment i made was to the if statement to add a check for empty maps <br /><br />like so<br /><br />(if (and (map? m) (not (empty? m)))<br /> recur<br /> base case<br />)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-12467669.post-80355388487874248082010-10-06T04:10:06.046-04:002010-10-06T04:10:06.046-04:00I've had to do the same thing in a recent proj...I've had to do the same thing in a recent project and came up with basically the same code. The only difference was I made flatten-keys a multiple arity function so you wouldn't have to clutter your namespace with flatten-keys* and flatten-keys.MEBhttps://www.blogger.com/profile/17762841948612190295noreply@blogger.com