Skip to content

Latest commit

 

History

History
45 lines (33 loc) · 967 Bytes

0055-cl-heredoc.org

File metadata and controls

45 lines (33 loc) · 967 Bytes

cl-heredoc

This module implements a syntax to read string literals in heredoc style. Such way of reading is also supported in some other languages.

Heredoc allows you to define a string literal where any symbols can be used:

POFTHEDAY> (set-dispatch-macro-character
            #\# #\>
            #'cl-heredoc:read-heredoc)

POFTHEDAY> #>some stop sequence>And now I can
use any characters even different quotes:

- '
- "
some stop sequence

;; result is:

"And now I can
use any characters even different quotes:

- '
- \"
"

With cl-heredoc you can write anything you want without escaping. This might be useful in some cases.

Also, it exports a function read-until-match which might be used to read from a string until a given subsequence.