Welcome! Please see the About page for a little more info on how this works.

+1 vote
in Syntax and reader by
No-op macros are line comments (starting with {{#!}} or {{;}}), {{#_}}, reader conditional (splicing or not) with no matching feature.
Furthermore once a no-op macro has been read regular whitespace are allowed anew.

Examples:
Namespaced map {{#foo{:bar :baz}}}

#:#_()#! bang bang
#?(:whatever 42); now a blank line

#?@(:default ())foo
{:bar :baz}


Tagged literal {{#inst "2017-04-24T09:11:29.878-00:00"}}

##_()#! bang bang
#?(:whatever 42); now a blank line

inst "2017-04-24T09:11:29.878-00:00"


Anonymous argument: {{#(do %1)}}

#(do %#_()#! bang bang
#?(:whatever 42); now a blank line

#?@(:default ())1)


In addition anonymous arguments implementation is leaky (any {{%n}} is accepted as long as {{n}} is (-2.0 -1.0] (mapping to {{%&}}) and [1.0 Infinity) and any representation can be used (bigdec or bigint or float or integers in any basis).


#(list %#_(first arg)1.00000001 %#_(secong arg)2r10 %#_(rest arg)-1.5)

3 Answers

0 votes
by

Comment made by: cgrand

The patch extracts the body from the read loop to expose a readSome method that returns either a form or the reader (if no valued form has been read starting at the current position).
This patch also adds a regex pattern to validate anonymous args.

0 votes
by

Comment made by: cgrand

clj2160-2 is clj2160 + two redundant checks that were not removed

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJ-2160 (reported by cgrand)
...