The attention-span constraint gives this challenge the aspect of a 
migration.  Consider it that way and solutions emerge.  In particular - 
attend to the interfaces between functions, and do whatever you like inside 
the functions.  You could adjust the program incrementally, whenever 
convenient. During the transition your program would remain operable. 
 There is more than one way to do this.  

In any case you would prepare by writing array-to-map and map-to-array 
translator functions (with very short names).  Then you could modernize a 
function by converting its arguments to maps on their way in, and 
converting outputs to arrays on their way out.  Eventually your program 
would contain a ton of a->m and m->a calls and you could decide whether you 
had the attention span to finish the job and get rid of them.  

A twist on this technique, if attention span permits, would involve less 
noise but more work at the outset:  adapt every function, all at once, with 
an adapter of its inputs, m?->a because initially all functions want 
arrays.  Then there will be no need to instrument the functions' outputs. 
 As you convert each function to desire maps instead of arrays, switch its 
m?->a to a?->m. Here the translators have question-marks because they 
should pass-through the parameter without changing it if it's already the 
right shape.  When every function has been switched over to a?->m, all the 
arrays will have vanished into the history books and you may remove the 
adapters.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to