2023-03-03 18:02:10 +03:00
|
|
|
|
|
|
|
```ucm:hide
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> builtins.merge
|
2023-03-03 18:02:10 +03:00
|
|
|
```
|
|
|
|
|
2023-03-03 22:32:31 +03:00
|
|
|
This transcript shows some syntax for raw text literals.
|
2023-03-03 18:02:10 +03:00
|
|
|
|
|
|
|
```unison
|
|
|
|
lit1 = """
|
|
|
|
This is a raw text literal.
|
|
|
|
It can start with 3 or more ",
|
|
|
|
and is terminated by the same number of quotes.
|
|
|
|
Nothing is escaped. \n
|
|
|
|
|
|
|
|
The initial newline, if it exists, is ignored.
|
2023-07-21 07:55:12 +03:00
|
|
|
The last line, if it's just whitespace up to the closing quotes,
|
|
|
|
is ignored.
|
|
|
|
|
|
|
|
Use an extra blank line if you'd like a trailing newline. Like so:
|
|
|
|
|
2023-03-03 18:02:10 +03:00
|
|
|
"""
|
|
|
|
|
|
|
|
> lit1
|
2023-03-04 00:10:30 +03:00
|
|
|
> Some lit1
|
2023-03-03 18:02:10 +03:00
|
|
|
|
|
|
|
lit2 = """"
|
2023-03-04 00:10:30 +03:00
|
|
|
This is a raw text literal, indented.
|
|
|
|
It can start with 3 or more ",
|
|
|
|
and is terminated by the same number of quotes.
|
|
|
|
Nothing is escaped. \n
|
2023-03-03 18:02:10 +03:00
|
|
|
|
2023-03-04 00:10:30 +03:00
|
|
|
This doesn't terminate the literal - """
|
|
|
|
""""
|
2023-03-03 18:02:10 +03:00
|
|
|
|
|
|
|
> lit2
|
2023-03-03 22:32:31 +03:00
|
|
|
> Some lit2
|
|
|
|
```
|
|
|
|
|
|
|
|
```ucm
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> add
|
|
|
|
scratch/main> view lit1 lit2
|
2023-03-03 18:02:10 +03:00
|
|
|
```
|