I wish to toss out a new thought. To that end let me blow up the example
to underline a scalability issue:
A. q ++ " " ++ a ++ " " ++ z ++ " [" ++ m ++ " -> " ++ k ++ " |" ++ p ++ "| "
++ g ++ " -> " ++ c ++ "] " ++ h ++ " " ++ b ++ " " ++ f ++ " " ++ i
B. printf "%s %s %s [%s -> %s |%s| %s -> %s] %s %s %s %s" q a z m k p g c h
b f i
B looks clearer because without parsing you can see that the output will
contain a |blah| between two blah->blah's inside square brackets, etc.
A looks clearer because without counting you can see that p is the
thing that will go into |blah|, the first blah->blah will be m->k,
etc.
The best of both worlds may be something like the notation in the HOL
theorem prover:
``^q ^a ^z [^m -> ^k |^p| ^g -> ^c] ^h ^b ^f ^i``
Do you agree that this is much better?
this syntax is used in Perl, and, IMHO, is very convenient.
Also very convenient are HERE-docs, when user should not bother about
escaping and concatenating of large strings.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe