Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix "~n@*"-directives in clojure.pprint/cl-format. Fixes #CLJ-1134.
This solves two issues as specified by #CLJ-1134. Issue #1 is solved by doing a relative jump forward within `absolute-reposition` in cl_format.clj, line 114 by switching `(- (:pos navigator) position)` with `(- position (:pos navigator))`. Issue #2 is handled by changing the default `n`-parameter to `*` depending on whether the `@`-prefix is placed or not. If it is placed, then `n` defaults to 0, otherwise it defaults to 1. In addition, new tests have been appended to `test_cl_format.clj` to ensure the correctness of this patch. The tests have been tested on the Common Lisp implementation GNU CLISP 2.49, which presumably handle the `~n@*` correctly. This patch and GNU CLISP returns the same output for each format call, sans case for printed symbols; Common Lisp has case-insensitive symbols, whereas Clojure has not. Signed-off-by: Stuart Halloway <stu@cognitect.com>
- Loading branch information