Clojure

Improve apropos to show some indication of namespace of symbols found

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: Release 1.5, Release 1.6
  • Fix Version/s: Release 1.7
  • Component/s: None
  • Labels:
  • Patch:
    Code and Test
  • Approval:
    Ok

Description

apropos does find all symbols in all namespaces that match the argument, but the return value gives no clue as to which namespace the found symbols are in. It can even return multiple occurrences of the same symbol, which only gives a clue that the symbol exists in more than one namespace, but not which ones. For example:

user=> (apropos "replace")
(postwalk-replace prewalk-replace replace re-quote-replacement replace replace-first)

user=> (apropos 'macro)
(macroexpand-all macroexpand macroexpand-1 defmacro)

It would be nice if the returned symbols could indicate the namespace.

With the screened patch clj-1191-v3.patch applied the output for the examples above becomes:

user=> (apropos "replace")
(clojure.core/replace clojure.string/re-quote-replacement clojure.string/replace clojure.string/replace-first clojure.walk/postwalk-replace clojure.walk/prewalk-replace)

user=> (apropos 'macro)
(clojure.core/defmacro clojure.core/macroexpand clojure.core/macroexpand-1 clojure.walk/macroexpand-all)

Patch: clj-1191-v3.patch

Screened by: Alex Miller

  1. clj-1191-patch-v1.txt
    04/Apr/13 8:25 PM
    3 kB
    Andy Fingerhut
  2. clj-1191-patch-v2.txt
    20/Aug/14 12:27 PM
    3 kB
    Andy Fingerhut
  3. clj-1191-v3.patch
    20/Aug/14 5:05 PM
    3 kB
    Andy Fingerhut

Activity

Andy Fingerhut made changes -
Field Original Value New Value
Attachment clj-1191-patch-v1.txt [ 11942 ]
Andy Fingerhut made changes -
Patch Code [ 10001 ]
Alex Miller made changes -
Approval Triaged [ 10120 ]
Alex Miller made changes -
Labels repl
Alex Miller made changes -
Priority Minor [ 4 ] Major [ 3 ]
Rich Hickey made changes -
Approval Triaged [ 10120 ] Vetted [ 10003 ]
Rich Hickey made changes -
Fix Version/s Release 1.7 [ 10250 ]
Alex Miller made changes -
Approval Vetted [ 10003 ] Incomplete [ 10006 ]
Andy Fingerhut made changes -
Attachment clj-1191-patch-v2.txt [ 13240 ]
Alex Miller made changes -
Patch Code [ 10001 ] Code and Test [ 10002 ]
Approval Incomplete [ 10006 ] Vetted [ 10003 ]
Alex Miller made changes -
Approval Vetted [ 10003 ] Incomplete [ 10006 ]
Priority Major [ 3 ] Minor [ 4 ]
Andy Fingerhut made changes -
Attachment clj-1191-patch-v3.txt [ 13242 ]
Andy Fingerhut made changes -
Attachment clj-1191-v3.patch [ 13243 ]
Andy Fingerhut made changes -
Attachment clj-1191-patch-v3.txt [ 13242 ]
Alex Miller made changes -
Approval Incomplete [ 10006 ] Screened [ 10004 ]
Description apropos does find all symbols in all namespaces that match the argument, but the return value gives no clue as to which namespace the found symbols are in. It can even return multiple occurrences of the same symbol, which only gives a clue that the symbol exists in more than one namespace, but not which ones. For example:

user=> (apropos "replace")
(postwalk-replace prewalk-replace replace re-quote-replacement replace replace-first)

It would be nice if the returned symbols could indicate the namespace, either always, or if the found symbol is not in the current namespace.
apropos does find all symbols in all namespaces that match the argument, but the return value gives no clue as to which namespace the found symbols are in. It can even return multiple occurrences of the same symbol, which only gives a clue that the symbol exists in more than one namespace, but not which ones. For example:

{code}
user=> (apropos "replace")
(postwalk-replace prewalk-replace replace re-quote-replacement replace replace-first)
{code}

It would be nice if the returned symbols could indicate the namespace.

*Patch:* clj-1191-v3.patch

*Screened by:* Alex Miller

Andy Fingerhut made changes -
Description apropos does find all symbols in all namespaces that match the argument, but the return value gives no clue as to which namespace the found symbols are in. It can even return multiple occurrences of the same symbol, which only gives a clue that the symbol exists in more than one namespace, but not which ones. For example:

{code}
user=> (apropos "replace")
(postwalk-replace prewalk-replace replace re-quote-replacement replace replace-first)
{code}

It would be nice if the returned symbols could indicate the namespace.

*Patch:* clj-1191-v3.patch

*Screened by:* Alex Miller

apropos does find all symbols in all namespaces that match the argument, but the return value gives no clue as to which namespace the found symbols are in. It can even return multiple occurrences of the same symbol, which only gives a clue that the symbol exists in more than one namespace, but not which ones. For example:

{code}
user=> (apropos "replace")
(postwalk-replace prewalk-replace replace re-quote-replacement replace replace-first)

user=> (apropos 'macro)
(macroexpand-all macroexpand macroexpand-1 defmacro)
{code}

It would be nice if the returned symbols could indicate the namespace.

With the screened patch clj-1191-v3.patch applied the output for the examples above becomes:

{code}
user=> (apropos "replace")
(clojure.core/replace clojure.string/re-quote-replacement clojure.string/replace clojure.string/replace-first clojure.walk/postwalk-replace clojure.walk/prewalk-replace)

user=> (apropos 'macro)
(clojure.core/defmacro clojure.core/macroexpand clojure.core/macroexpand-1 clojure.walk/macroexpand-all)
{code}

*Patch:* clj-1191-v3.patch

*Screened by:* Alex Miller

Rich Hickey made changes -
Approval Screened [ 10004 ] Ok [ 10007 ]
Stuart Halloway made changes -
Resolution Completed [ 1 ]
Status Open [ 1 ] Closed [ 6 ]

People

Vote (1)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: