
On Mon, Sep 2, 2013 at 5:43 AM, Richard A. O'Keefe wrote:
A slogan I have programmed by since I first met C and recognised how vastly superior to PL/I it was for text manipulation _because_ it didn't have a proper string type is "Strings are Wrong!".
I wonder if you notice the irony in your use of 'C' as exemplar in this context? C rode to fame on the back of Unix. And Unix's innovation - one of many - is that at the OS level the string type was made common fare - a universal type. So everything from file names to file contents to IPC is a string. Of course when instructing a beginning programmer your basic premise 'Strings are Wrong!' is most likely right. However if programs are seen as entities interacting with an 'external' world, the currency at the portals is invariably string. And more than just noob programmers have got this wrong - think of the precious one-byte opcodes that Intel wastes on ascii and decimal arithmetic. So while this is true: If bar is predefined, it *isn't* the string 'b':'a':'r':[].
If bar is a number, it *isn't* a string. So "other strings" is quite misleading.
in the innards of haskell, bar is a string On Sun, Sep 1, 2013 at 9:51 PM, Albert Y. C. Lai wrote:
When 3 and 1/2 are typed next to each other, i.e.,
3 1/2
it is addition.
Well mathematicians are always eliding! In 3 1/2 the elision amounts to + In xy it amounts to * And within 23 ie between the 2 and the 3, it amounts to λ x y -> 10*x + y And Haskell elides function application When teaching gofer (in the early 90s) I found that undoing the elision of function application and making it explicit, made FP more withing reach of the kids. Idea inspired by Dijkstra http://www.the-magus.in/Publications/ewd.pdf And more recently summarized http://blog.languager.org/2013/08/applying-si-on-sicp.html Rusi -- http://www.the-magus.in http://blog.languager.org