Clojure

clojure.repl namespace

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: Release 1.2
  • Component/s: None
  • Labels:
    None
  • Approval:
    Ok

Description

promote the following fns

  • clojure.contrib.repl-utils/source to clojure.repl/source
  • clojure.contrib.repl-utils/apropos to clojure.repl/apropos
  • clojure.contrib.ns-utils/dir to clojure.repl/dir

Also:

  • promote any necessary helper fns
  • make sure helper fns are private
  • promote and or write unit tests
  • make the clojure repl use these four fns

Activity

Hide
Assembla Importer added a comment -

chouser@n01se.net said: Not interested in "show", perhaps with a better name? clojure.java/classinfo or something?

For tickets like this do you actually want a patch against clojure, or is this more of a placeholder for eventual work by someone else?

Show
Assembla Importer added a comment - chouser@n01se.net said: Not interested in "show", perhaps with a better name? clojure.java/classinfo or something? For tickets like this do you actually want a patch against clojure, or is this more of a placeholder for eventual work by someone else?
Hide
Assembla Importer added a comment -

scgilardi said: - "show" is the repl-util I use most often. I think it should be included.

  • Abstractly I think these are more development tools than things particularly about a repl. Perhaps clojure.dev would be a better name than clojure.repl.
Show
Assembla Importer added a comment - scgilardi said: - "show" is the repl-util I use most often. I think it should be included.
  • Abstractly I think these are more development tools than things particularly about a repl. Perhaps clojure.dev would be a better name than clojure.repl.
Hide
Assembla Importer added a comment -

stu said: updated description, hopefully now dev-able by anybody

Show
Assembla Importer added a comment - stu said: updated description, hopefully now dev-able by anybody
Hide
Assembla Importer added a comment -

stu said: pulling javadoc for now, due to the number of dependencies. May re-open it as a separate ticket.

Show
Assembla Importer added a comment - stu said: pulling javadoc for now, due to the number of dependencies. May re-open it as a separate ticket.
Hide
Assembla Importer added a comment -

tvachon said: [file:c6elQ8u8ur34WNeJe5cbLA]: Clojure core patch

Show
Assembla Importer added a comment - tvachon said: [file:c6elQ8u8ur34WNeJe5cbLA]: Clojure core patch
Hide
Assembla Importer added a comment -

tvachon said: [file:c6qz7Ou8ur34WNeJe5cbLA]: Clojure contrib patch

Show
Assembla Importer added a comment - tvachon said: [file:c6qz7Ou8ur34WNeJe5cbLA]: Clojure contrib patch
Hide
Assembla Importer added a comment -

tvachon said: A couple items I'm not sure I got right:

  • promoting macros necessitated promoting the functions they used directly, but this could be avoided with * functions, I believe
  • some public contrib functions are now repeated verbatim as private functions in clojure.repl. I left comments in clojure.contrib, which may not be appropriate.

Let me know - happy to update the patches.

Show
Assembla Importer added a comment - tvachon said: A couple items I'm not sure I got right:
  • promoting macros necessitated promoting the functions they used directly, but this could be avoided with * functions, I believe
  • some public contrib functions are now repeated verbatim as private functions in clojure.repl. I left comments in clojure.contrib, which may not be appropriate.
Let me know - happy to update the patches.
Hide
Assembla Importer added a comment -

stu said: Wow, print-dir sure sucks in a lot of stuff. I think we can avoid it. Can you update the clojure patch to:

  • leave out throwable?, throwable, and throw-if, and get-ns
  • have print-dir call find-ns directly, do an if-let existence test, and throw an exception if the ns is not found

Thanks!

Show
Assembla Importer added a comment - stu said: Wow, print-dir sure sucks in a lot of stuff. I think we can avoid it. Can you update the clojure patch to:
  • leave out throwable?, throwable, and throw-if, and get-ns
  • have print-dir call find-ns directly, do an if-let existence test, and throw an exception if the ns is not found
Thanks!
Hide
Assembla Importer added a comment -

tvachon said: Indeed! Patches are updated, and I think they're much nicer.

I've also restored print-dir in contrib and added dir* in clojure.repl, which has slightly different semantics (in particular, it expects a symbol input, not a Namespace). We don't use print-dir anywhere in clojure-contrib now, but in case anyone else does this should minimize issues.

Show
Assembla Importer added a comment - tvachon said: Indeed! Patches are updated, and I think they're much nicer. I've also restored print-dir in contrib and added dir* in clojure.repl, which has slightly different semantics (in particular, it expects a symbol input, not a Namespace). We don't use print-dir anywhere in clojure-contrib now, but in case anyone else does this should minimize issues.
Hide
Assembla Importer added a comment -

stu said: Thanks Travis,

Thanks to the new "last var in wins" feature in Clojure, there is no need to remove these fns from clojure-contrib. They can stay there, and not break people who already use them that way. So we will apply only Clojure-side patch.

Show
Assembla Importer added a comment - stu said: Thanks Travis, Thanks to the new "last var in wins" feature in Clojure, there is no need to remove these fns from clojure-contrib. They can stay there, and not break people who already use them that way. So we will apply only Clojure-side patch.
Hide
Assembla Importer added a comment -
Show
Assembla Importer added a comment - stu said: [file:cEvRP-wc8r36MfeJe5cbCb]
Hide
Assembla Importer added a comment -

stu said: My May 5 patch includes Travis' original patch for the Clojure side, and adds a second commit that puts the (use 'clojure.repl) in the right place in main.clj, and removes the dependency on the now-defunct "seq-contains?". The two patch approach preserves provenance but means that there is an intermediate commit where the build is broken.

Should we move towards a common convention for relating the names of macros and their driver fns? This patch has dir/dir* but source/get-source.

Show
Assembla Importer added a comment - stu said: My May 5 patch includes Travis' original patch for the Clojure side, and adds a second commit that puts the (use 'clojure.repl) in the right place in main.clj, and removes the dependency on the now-defunct "seq-contains?". The two patch approach preserves provenance but means that there is an intermediate commit where the build is broken. Should we move towards a common convention for relating the names of macros and their driver fns? This patch has dir/dir* but source/get-source.
Hide
Assembla Importer added a comment -

richhickey said: Whatever the convention is, I'm wary of blah*. In Clojure the * version is often a primitive thing. Something* is also a nice (as yet unused) variant for other meanings. Double leading underscore is pretty ugly and obviously internal to most people

Show
Assembla Importer added a comment - richhickey said: Whatever the convention is, I'm wary of blah*. In Clojure the * version is often a primitive thing. Something* is also a nice (as yet unused) variant for other meanings. Double leading underscore is pretty ugly and obviously internal to most people
Hide
Assembla Importer added a comment -

richhickey said: blah-impl is fine too

Show
Assembla Importer added a comment - richhickey said: blah-impl is fine too
Hide
Assembla Importer added a comment -

tvachon said: I like the double leading underscore. Stuart - would you like me to update the original patch? I'd be happy to incorporate your changes as well if you think that's appropriate.

It's a minor matter, but I also noticed that I'm using my weatherbill.com email address, which maybe isn't ideal, as this work wasn't done in that scope. That leads to a second question, probably best taken out of this but, about corporate CLAs, but I'll bring that up in a different forum.

Thanks!

Show
Assembla Importer added a comment - tvachon said: I like the double leading underscore. Stuart - would you like me to update the original patch? I'd be happy to incorporate your changes as well if you think that's appropriate. It's a minor matter, but I also noticed that I'm using my weatherbill.com email address, which maybe isn't ideal, as this work wasn't done in that scope. That leads to a second question, probably best taken out of this but, about corporate CLAs, but I'll bring that up in a different forum. Thanks!
Hide
Assembla Importer added a comment -

tvachon said: er - s/taken out of this but/taken out of this ticket/

Show
Assembla Importer added a comment - tvachon said: er - s/taken out of this but/taken out of this ticket/
Hide
Assembla Importer added a comment -

stu said: In this case (and perhaps in many cases) the driver fns might actually need to be called, so I don't like the __. blah-impl is fine, if you would like to make that change please do.

Show
Assembla Importer added a comment - stu said: In this case (and perhaps in many cases) the driver fns might actually need to be called, so I don't like the __. blah-impl is fine, if you would like to make that change please do.
Hide
Assembla Importer added a comment -

richhickey said: If we are intending to have people call the fns, like dir* and get-source, then what is here is not ok.

If the macros are just macros for quoting purposes, I think we should establish a macro/macro-fn naming convention. Also, the dir* fn probably shouldn't print, i.e. the functions, if they are to have utility as functions, should be (real) functions, i.e. no side effects, return data structures, in which case the division of labor between dir and dir* (to be dir-fn) needs to change.

Show
Assembla Importer added a comment - richhickey said: If we are intending to have people call the fns, like dir* and get-source, then what is here is not ok. If the macros are just macros for quoting purposes, I think we should establish a macro/macro-fn naming convention. Also, the dir* fn probably shouldn't print, i.e. the functions, if they are to have utility as functions, should be (real) functions, i.e. no side effects, return data structures, in which case the division of labor between dir and dir* (to be dir-fn) needs to change.
Hide
Assembla Importer added a comment -
Show
Assembla Importer added a comment - stu said: [file:d6k246wFSr35tLeJe5cbLr]
Hide
Assembla Importer added a comment -

stu said: may 7 patch subsumes the others and is ready for review

Show
Assembla Importer added a comment - stu said: may 7 patch subsumes the others and is ready for review
Hide
Assembla Importer added a comment -

stu said: Updating tickets (#310, #318, #341)

Show
Assembla Importer added a comment - stu said: Updating tickets (#310, #318, #341)

People

  • Assignee:
    Unassigned
    Reporter:
    Anonymous
Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: