On 06/28/2011 08:25 PM, Krzysztof Skrzętnicki wrote:
What about Literate Haskell then? People write a lot of LH blog posts,
so it would seem to be quite flexible.

IMHO, these are different tasks.

* "Embed Haskell into some other language" is solved by Literate Haskell

* "Embed some other language into Haskell" is solved by heredocs

Btw., does TH parse this correctly? (If I was TH, I would not):

> myPHPCode = [s|
> <?php
> $description = "Use the quasiquoter like this: [s|some text|]";
> print $description."\n";
> ?>
> |]

(the tricky part is "|]" occurring in the quoted text)

Can we escape it?

-- Steffen


Best regards,
Krzysztof Skrzętnicki

On Tue, Jun 28, 2011 at 16:13, Dave Bayer <ba...@cpw.math.columbia.edu
<mailto:ba...@cpw.math.columbia.edu>> wrote:

    Part of the dominance of scripting languages is clean support for
    heredocs. So much of every arena of life comes down to getting "It's
    not about me!" I love Haskell but it doesn't get this. Imagine a
    document that's nominally Haskell, but about 80% some other language
    such as TeX (e.g. code for a self-generating textbook). Anything
    short of "these lines belong to the other language, with not a
    single intervening character in the way" simply doesn't work. So,
    yes, Haskell supports multi-line strings, but not heredocs, a subtle
    but crucial syntactic distinction. Restated, one can cut and paste
    many entire lines of foreign code into a heredoc, with no worries
    about conversion.

    Heredocs should be part of the base spec of any credible language,
    with the requirement "Can the language completely disappear behind
    another language, in the source file?" As I said, the key issue is
    getting "It's not about me!"

    On Jun 28, 2011, at 1:57 AM, Jean-Marie Gaillourdet wrote:

     > Hi Audrey,
     >
     > are you aware that Haskell already supports multi-line strings?
     >
     > foo = "This is a\
     >       \multi-line\
     >       \string!"
     >
     > See Section 2.6 of http://haskell.org/onlinereport/lexemes.html
     >
     > Regards,
     >  Jean

    _______________________________________________
    Haskell mailing list
    Haskell@haskell.org <mailto:Haskell@haskell.org>
    http://www.haskell.org/mailman/listinfo/haskell




_______________________________________________
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell

_______________________________________________
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to