Dan, 

Good point in general.

However, in this case, the function returned is used to make cryptograms, 
simple "cryptographic" word puzzles. Characters outside a-z, A-Z, 0-9 are 
passed through by design to leave punctuation and whitespace in place to 
provide structure to aid the person solving the puzzle. Stripping the 
context or shuffling them would make the problem harder. Too hard for 
intended audience.

-- Shannon Severance

On Thursday, June 13, 2013 11:49:34 AM UTC-7, Alan Thompson wrote:
>
> One thing that threw me at first was the double arg in the function #(encrypt 
> % %).  It took a while before I realized you were supplying each character 
> as both the map key value and a default return value (thus, a 
> non-alphanumeric char like * would come through w/o translation).  
>
> While this works, what I would do instead is be more explicit that only 
> certain chars are allowed in the first place.  So, I'd add a filter up 
> front that would throw an exception if any non-alphanumeric char were 
> encountered.  I can't tell you how many times this "fail-fast" type of 
> behavior has saved me, since it makes bugs easy to find rather than burying 
> the cause of a problem (kinda like getting an error at compile-type instead 
> of at runtime).
>
> Alan Thompson
>
>

-- 
-- 
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/groups/opt_out.


Reply via email to