Suggestions to triple quoted strings proposal

P T Withington ptw at pobox.com
Wed Dec 13 08:03:20 PST 2006


On 2006-12-13, at 10:13 EST, Dave Herman wrote:

>> It doesn't seem particularly arduous to do:
>> function query() {
>>   return
>>   """SELECT 15
>>   FROM dual
>>   """
>> }
>
> I haven't been following this thread closely, but the above will  
> not parse; you aren't allowed to move the argument to a return to  
> the next line. The parser will parse that as a return with no  
> arguments.

One of the biggest traps of implicit `;`s.  Bitten me too many  
times!  But you _could_ say:

function query() {
   return (
"""SELECT 15
FROM dual
""")
}

Since I'm here, I'll just toss out the Dylan way, which is to have  
adjacent strings concatenate:

function query() {
   return (
    "SELECT 15"
    " FROM dual"
   )
}




More information about the Es4-discuss mailing list