RSS Feed

Lisp Project of the Day

cl-heredoc

You can support this project by donating at:

Donate using PatreonDonate using Liberapay

cl-heredocioreadtable

Documentation🥺
Docstrings😀
Tests 😀
Examples😀
RepositoryActivity🥺
CI 🥺

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.


Brought to you by 40Ants under Creative Commons License