开发者

KRL extended quoting

There are two ways to do extended quoting in KRL. One of them is documented under Literals on Kynetx Docs. That looks like this:

var = <<
  Some text
>>;

That syntax allows you to embed beestings (e.g., #{var}) in the text.

However, I've also seen another syntax used, with <| ... |> 开发者_JAVA百科instead. What is the difference between these two types of extended quoting mechanisms? What are the limitations/advantages of each?


<<>> extended quotes are used for text and html.

<| |> extended quotes are used for javascript. Using these quotes when emitting javascript allows for the engine to process it as javascript, which not only parses faster, but also has different handling for newlines.

emit should always be used with <| |>.

Fun Fact: We call these clownhats. :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜