State function's unmunged full name in compiled function's toString()

Description

Currently function instances print their toString() with the munged Java name:

For debugging purposes, it would be useful to have the function toString() describe the Clojure-oriented fn name.

Approach: Store the original name in the function instance and use it in the toString() rather than returning the class name.

Tradeoffs: Increased function instance size for the function name.

Patch: CLJ-1278-2.patch

Environment

None

Activity

Show:
Alex Miller
May 17, 2015, 5:06 PM

Munge+demunge is a lossy operation. Consider demunge as "best effort", not something to rely on.

Steve Miner
May 17, 2015, 3:06 PM

You could instead implement toString() on something like AFn.java.

Howard Lewis Ship
November 26, 2014, 10:09 PM

Alex, thanks for the advice. I'll follow through. Some of that data is already present, but I can make it more prominent.

I know that I'm overwhelmed by the number of issues (including enhancements and minor improvements) on the Tapestry issue list, so I'm understanding of problem space.

Alex Miller
November 26, 2014, 9:43 PM

There are ~400 open tickets for Clojure. As a printing enhancement, this is generally considered lower priority than defects. Additionally, the proposal changes the compiler, bytecode generation code, and adds fields to generated objects, which has unassessed and potentially wide impacts. The combination of these things means it might be a while before we get around to looking at it.

Things that you could do to help:
1) Simplify the description. Someone coming to this ticket (screeners and ultimately Rich) want to look at the description and get the maximal understanding with the minimal effort. We have some guidelines on this at http://dev.clojure.org/display/community/Creating+Tickets if you haven't seen it. For an enhancement, a short (1-2 sentence) description of the problem and an example I can run in the repl is best. Then a proposal (again, as short as possible). Examples: CLJ-1529, CLJ-1325, CLJ-1378. For an enhancement like this, seeing (succinct) before/after versions where a user will see this is often the quickest way for a screener to understand the benefit.

2) Anticipate and remove blockers. As I mentioned above, you are changing the size of every function object. What is the impact on size and construction time? Providing data and/or a test harness saves a screener from doing this work. It's better to leave details in attachments or comments and refer to it in the description if it's lengthy.

3) Have others screen (per http://dev.clojure.org/display/community/Screening+Tickets ) - while that is the job a screener (often me) will have to re-do, having more eyeballs on it early helps. Ask on #clojure for someone else to take a look, try it, etc. If there are open questions, leaving those in the description helps guide my work.

Howard Lewis Ship
November 26, 2014, 9:06 PM

Thanks for the info; don't want to come off as whiny but The Great Silence is off putting to someone who wants to help improve things.

I'll update my patch, and hope to see some motion for 1.8.

Your pinned fields
Click on the next to a field label to start pinning.

Assignee

Unassigned

Reporter

Howard Lewis Ship

Labels

Approval

Triaged

Patch

Code and Test

Priority

Major

Affects versions