A popular thing to do with computer languages (especially scripting
languages) is to  manipulate text and insert variables into strings.  
It is extremely irritating to escape in and out of strings via ++ in
Haskell or + in Java/Javascript.  
e.g. 
> var1 = 2*2
> var2 = 4*var1
> var3 = "Foobar""
> sqlstring = "insert into mytable values "++
>  "(NULL,'"++(show var1)++"','"++(show var2)++"','"++var3"');"

It would be much nicer if Haskell did what perl,php, and tcl do:
> sqlstring="insert into mytable values (NULL,'$var1','$var2','$var3')".
Even nicer would be:
> sqlstring="insert into mytable values
  (NULL,'$var1','$(var1+var2)','$var3')".

(Notice both the embedded evaluation and the fact that the string runs
accross multiple lines)

Supporting this feature involves either:
a. a syntactic transformation after you have type information (don't
'show' strings)
or 
b. redefining show string not to return quotation marks

To me the second makes more sense, but either way, this feature would make 
haskell programming much less annoying.


-Alex-

PS Why does show string return quotation marks?  It seems inconsistent.

___________________________________________________________________
S. Alexander Jacobson                   Shop.Com
1-212-697-0184 voice                    The Easiest Way To Shop



Reply via email to