Skip to content

Commit

Permalink
eep 62: fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
kikofernandez committed Dec 20, 2023
1 parent 936125f commit ef71005
Showing 1 changed file with 17 additions and 29 deletions.
46 changes: 17 additions & 29 deletions eeps/eep-0062.md
Expand Up @@ -15,15 +15,11 @@ into string constants to make constructing compound strings more readable.

For example, the new syntax:

```
bf"A utf-8 binary string: ~2 + 2~"
```
bf"A utf-8 binary string: ~2 + 2~"

would evaluate to:

```
<<"A utf-8 binary string: 4"/utf8>>
```
<<"A utf-8 binary string: 4"/utf8>>

Feature outline
========
Expand All @@ -33,29 +29,21 @@ unicode codepoint list, and user-facing or developer-facing formatting).

The result are four general classes of syntax with interpolated values:

```
% binary format
<<"A utf-8 binary string: 4"/utf8>> =
bf"A utf-8 binary string: ~2 + 2~"
```

```
% list format
"A unicode codepoint list string: 4" =
lf"A unicode codepoint list string: ~2 + 2~"
```

```
% binary debug
<<"A utf-8 binary string: {4, foo, [x, y, z]}"/utf8>> =
bd"A utf-8 binary string: ~{2 + 2, foo, [x, y, z]}~"
```

```
% list debug
"A unicode codepoint list string: {4, foo, [x, y, z]}" =
ld"A unicode codepoint list string: ~{2 + 2, foo, [x, y, z]}~"
```
% binary format
<<"A utf-8 binary string: 4"/utf8>> =
bf"A utf-8 binary string: ~2 + 2~"

% list format
"A unicode codepoint list string: 4" =
lf"A unicode codepoint list string: ~2 + 2~"

% binary debug
<<"A utf-8 binary string: {4, foo, [x, y, z]}"/utf8>> =
bd"A utf-8 binary string: ~{2 + 2, foo, [x, y, z]}~"

% list debug
"A unicode codepoint list string: {4, foo, [x, y, z]}" =
ld"A unicode codepoint list string: ~{2 + 2, foo, [x, y, z]}~"

Arbitrary expressions can be nested inside string interpolation
substitutions, including variables, function calls, macros and
Expand Down

0 comments on commit ef71005

Please sign in to comment.