Allow ** as a valid symbol name without triggering "not declared dynamic" warnings

Description

Currently declaring a symbol ** triggers a compiler warning:

** is a useful symbol in many domains, e.g. as an exponent function or as a matrix multiplication operator.

Cause: This warning checks for a def of a symbol that starts and ends with *.

Solution: Change check for name length >2 to skip this particular case.

Patch: clj-1233-with-test-v2.diff

Screened by: Alex Miller

Environment

All

Attachments

4

Activity

Show:

Andy Fingerhut September 6, 2013 at 12:24 AM

Patch clj-1233-with-test-v2.txt is identical to Mike Anderson's clj-1233-with-test.diff (preserving his authorship), except it avoids git warnings when applying by eliminating trailing whitespace in added lines.

Mike Anderson July 29, 2013 at 6:32 PM

New patch with a test that includes using "with-err-print-writer" to detect the avoidance of the warning.

Alex Miller July 25, 2013 at 9:21 PM

There are some test helpers in Clojure's test/clojure/test_helper.clj for capturing error messages.

Mike Anderson July 25, 2013 at 11:16 AM

Hmmm... is there a standard/reliable method for testing the presence / non-presence of emitted warnings?

Alex Miller July 24, 2013 at 6:17 PM

Minimal patch would be slightly less minimal with a test.

Completed

Details

Assignee

Reporter

Labels

Approval

Ok

Patch

Code and Test

Priority

Affects versions

Fix versions

Created July 23, 2013 at 11:30 AM
Updated October 25, 2013 at 5:01 PM
Resolved October 25, 2013 at 5:01 PM