You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on #670 I noticed that syntax highlighting for %<n> args does not match Clojure reader syntax or behavior.
Disclaimer: I acknowledge that %15 is unidiomatic and this is an insignificant corner case that shouldn't arise in 99.999% of Clojure programming. Nevertheless I'm reporting it because it's a clear bug.
Expected behavior
Reader-legal numbered percent-style parameters %1, %2...%n to shorthand-syntax anonymous functions #() should be syntax-highlighted.
Actual behavior
Only the first digit of %<n> anonymous functions #() parameters is syntax-highlighted. Additional digits are not. So %1, %2, ... %9 work, but %10 and further display incorrectly.
Steps to reproduce the problem
It is legal Clojure to provide up to MAX_POSITIONAL_ARITY args, per Compiler.java. More than that throws an exception "Can't specify more than 20 params". This matches observed behavior, which clearly supports up to %20:
(I don't think it's important or necessarily our job to distinguish between functional % args and syntax-legal ones, especially since the limit is parameterized (see below), so I say we fix %999 as well as %19.)
Environment & Version information
clojure-mode version
clojure-mode (version 5.18.0)
Emacs version
28.2
Operating system
macOS 13.5
The text was updated successfully, but these errors were encountered:
daveliepmann
added a commit
to daveliepmann/clojure-mode
that referenced
this issue
Nov 24, 2023
While working on #670 I noticed that syntax highlighting for
%<n>
args does not match Clojure reader syntax or behavior.Disclaimer: I acknowledge that
%15
is unidiomatic and this is an insignificant corner case that shouldn't arise in 99.999% of Clojure programming. Nevertheless I'm reporting it because it's a clear bug.Expected behavior
Reader-legal numbered percent-style parameters
%1
,%2
...%n
to shorthand-syntax anonymous functions#()
should be syntax-highlighted.Actual behavior
Only the first digit of
%<n>
anonymous functions#()
parameters is syntax-highlighted. Additional digits are not. So%1
,%2
, ...%9
work, but%10
and further display incorrectly.Steps to reproduce the problem
It is legal Clojure to provide up to
MAX_POSITIONAL_ARITY
args, per Compiler.java. More than that throws an exception "Can't specify more than 20 params". This matches observed behavior, which clearly supports up to%20
:(I don't think it's important or necessarily our job to distinguish between functional % args and syntax-legal ones, especially since the limit is parameterized (see below), so I say we fix
%999
as well as%19
.)Environment & Version information
clojure-mode version
Emacs version
28.2
Operating system
macOS 13.5
The text was updated successfully, but these errors were encountered: