Clojure

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

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Trivial Trivial
  • Resolution: Completed
  • Affects Version/s: Release 1.5
  • Fix Version/s: Release 1.6
  • Component/s: None
  • Labels:
  • Environment:
    All
  • Patch:
    Code and Test
  • Approval:
    Ok

Description

Currently declaring a symbol ** triggers a compiler warning:

user=> (defn ** [] nil)
Warning: ** not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic ** or change the name. (NO_SOURCE_PATH:1)
#'user/**

** 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

  1. clj-1233-minimal.diff
    23/Jul/13 12:29 PM
    1 kB
    Mike Anderson
  2. clj-1233-with-test.diff
    29/Jul/13 12:32 PM
    2 kB
    Mike Anderson
  3. clj-1233-with-test-v2.diff
    22/Oct/13 9:15 AM
    2 kB
    Alex Miller
  4. clj-1233-with-test-v2.txt
    05/Sep/13 6:24 PM
    2 kB
    Andy Fingerhut

Activity

Alex Miller made changes -
Field Original Value New Value
Description Currently declaring a symbol ** triggers a compiler warning:

"Warning: ** not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic ** or change the name."

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

It is proposed to fix this warning (by either allowing ** itself, or removing this warning altogether).
Currently declaring a symbol ** triggers a compiler warning:

"Warning: ** not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic ** or change the name."

\*\* is a useful symbol in many domains, e.g. as an exponent function.

It is proposed to fix this warning (by either allowing ** itself, or removing this warning altogether).
Mike Anderson made changes -
Attachment clj-1233-minimal.diff [ 12070 ]
Alex Miller made changes -
Description Currently declaring a symbol ** triggers a compiler warning:

"Warning: ** not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic ** or change the name."

\*\* is a useful symbol in many domains, e.g. as an exponent function.

It is proposed to fix this warning (by either allowing ** itself, or removing this warning altogether).
Currently declaring a symbol ** triggers a compiler warning:

"Warning: ** not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic ** or change the name."

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

It is proposed to fix this warning (by either allowing ** itself, or removing this warning altogether).
Alex Miller made changes -
Approval Triaged [ 10120 ]
Mike Anderson made changes -
Attachment clj-1233-with-test.diff [ 12077 ]
Andy Fingerhut made changes -
Patch Code and Test [ 10002 ]
Alex Miller made changes -
Labels Compiler bug Compiler
Rich Hickey made changes -
Approval Triaged [ 10120 ] Vetted [ 10003 ]
Fix Version/s Release 1.6 [ 10157 ]
Alex Miller made changes -
Approval Vetted [ 10003 ] Screened [ 10004 ]
Description Currently declaring a symbol ** triggers a compiler warning:

"Warning: ** not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic ** or change the name."

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

It is proposed to fix this warning (by either allowing ** itself, or removing this warning altogether).
Currently declaring a symbol ** triggers a compiler warning:

{code}
user=> (defn ** [] nil)
Warning: ** not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic ** or change the name. (NO_SOURCE_PATH:1)
#'user/**
{code}

\*\* 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.diff

*Screened by:* Alex Miller
Andy Fingerhut made changes -
Attachment clj-1233-with-test-v2.txt [ 12239 ]
Andy Fingerhut made changes -
Description Currently declaring a symbol ** triggers a compiler warning:

{code}
user=> (defn ** [] nil)
Warning: ** not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic ** or change the name. (NO_SOURCE_PATH:1)
#'user/**
{code}

\*\* 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.diff

*Screened by:* Alex Miller
Currently declaring a symbol ** triggers a compiler warning:

{code}
user=> (defn ** [] nil)
Warning: ** not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic ** or change the name. (NO_SOURCE_PATH:1)
#'user/**
{code}

\*\* 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.txt

*Screened by:* Alex Miller
Alex Miller made changes -
Description Currently declaring a symbol ** triggers a compiler warning:

{code}
user=> (defn ** [] nil)
Warning: ** not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic ** or change the name. (NO_SOURCE_PATH:1)
#'user/**
{code}

\*\* 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.txt

*Screened by:* Alex Miller
Currently declaring a symbol ** triggers a compiler warning:

{code}
user=> (defn ** [] nil)
Warning: ** not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic ** or change the name. (NO_SOURCE_PATH:1)
#'user/**
{code}

\*\* 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
Attachment clj-1233-with-test-v2.diff [ 12369 ]
Rich Hickey made changes -
Approval Screened [ 10004 ] Ok [ 10007 ]
Stuart Halloway made changes -
Resolution Completed [ 1 ]
Status Open [ 1 ] Closed [ 6 ]

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: