diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-06-11 07:46:11 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-06-11 07:46:11 -0700 |
commit | 2c72da160c2f43828316c262855c92e638872a70 (patch) | |
tree | 99f6815576b25ad7931fa40d95f2fd0de87e1d37 /tests/018 | |
parent | 607a764714e1d0391c663146a0c4701c19e15e35 (diff) | |
download | txr-2c72da160c2f43828316c262855c92e638872a70.tar.gz txr-2c72da160c2f43828316c262855c92e638872a70.tar.bz2 txr-2c72da160c2f43828316c262855c92e638872a70.zip |
pic: support quasiliteral as format string.
* share/txr/stdlib/pic.tl (pic): Refactor string compilation
code into local function which has access to the overall
argument list. Recognize the quasiliteral case and translate
by compiling all the string parts, then forming a recombined
quasiliteral where the compiled parts are substituted.
* tests/018/format.tl: test case for this.
* txr.1: Documented.
Diffstat (limited to 'tests/018')
-rw-r--r-- | tests/018/format.tl | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/018/format.tl b/tests/018/format.tl index 2e7f8b26..b8cf7445 100644 --- a/tests/018/format.tl +++ b/tests/018/format.tl @@ -126,3 +126,8 @@ (test (mapcar (do pic "foo~-0##.jpg") (rlist 0..5 8 12)) ("foo-000.jpg" "foo-001.jpg" "foo-002.jpg" "foo-003.jpg" "foo-004.jpg" "foo-005.jpg" "foo-008.jpg" "foo-012.jpg")) + +(test + (let ((a 2) (b "###") (c 13.5)) + (pic `abc@(+ a a)###.##@b>>>>` c "x")) + "abc4 13.50### x") |