From ef7100564cfc3575937a36d82e54345447006678 Mon Sep 17 00:00:00 2001 From: Kiko Fernandez-Reyes Date: Wed, 20 Dec 2023 15:40:41 +0100 Subject: [PATCH] eep 62: fix format --- eeps/eep-0062.md | 46 +++++++++++++++++----------------------------- 1 file changed, 17 insertions(+), 29 deletions(-) diff --git a/eeps/eep-0062.md b/eeps/eep-0062.md index b099005..8992e6b 100644 --- a/eeps/eep-0062.md +++ b/eeps/eep-0062.md @@ -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 ======== @@ -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