# Support for displaying non-identifier characters in help via #19858

**URL:** <https://discourse.julialang.org/t/support-for-displaying-non-identifier-characters-in-help-via-19858/1324>\
**Category:** Internals & Design\
**Created:** [January 6, 2017, 2:00pm UTC](https://discourse.julialang.org/t/support-for-displaying-non-identifier-characters-in-help-via-19858/1324 "2017-01-06T14:00:43Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ScottPJones](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/scottpjones/32/146_2.png) [@ScottPJones](https://discourse.julialang.org/u/ScottPJones)\
**Post date:** [January 6, 2017, 2:00pm UTC](https://discourse.julialang.org/t/support-for-displaying-non-identifier-characters-in-help-via-19858/1324/1 "2017-01-06T14:00:43Z")

</div>

I love @stevengj new PRs that just got merged, just found a minor problem though:

```julia
help?> ⊻
"⊻" can be typed by \xor<tab>
help?> †
ERROR: Invalid @var syntax `invalid character "†"`.

```

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [January 6, 2017, 3:42pm UTC](https://discourse.julialang.org/t/support-for-displaying-non-identifier-characters-in-help-via-19858/1324/2 "2017-01-06T15:42:07Z")

</div>

This is unrelated to PR #19858: a similar error message occurs in Julia 0.5 and 0.4, because `†` (`\dagger`) is currently not allowed in identifiers. There are two separate issues here:

First, whether the REPL help should print something more helpful if you enter an invalid identifier, rather than throwing an error (although the error message is somewhat informative).

Second, whether `†` should be allowed in identifiers. It wasn’t added when support for other Unicode math symbols was added to the parser, because it wasn’t clear whether we should parse it as part of identifiers or as an operator. (My inclination would be to parse it as an identifier character, since we already have `a'` for the adjoint.)

---

<div class="post-metadata">

**Author:** ![ScottPJones](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/scottpjones/32/146_2.png) [@ScottPJones](https://discourse.julialang.org/u/ScottPJones)\
**Post date:** [January 6, 2017, 4:04pm UTC](https://discourse.julialang.org/t/support-for-displaying-non-identifier-characters-in-help-via-19858/1324/3 "2017-01-06T16:04:37Z")

</div>

OK, but I’d say that it is an implementation detail that the display in Help of how to type a particular character via LaTeX (or Emoji) tab completion via #19858 only displays that information for valid identifiers.

I hadn’t intended at all to bring up any issues of whether or not \dagger is a valid identifier.  
I was strictly thinking of the usefulness of being able to paste any character at the `help?>` prompt and easily find out how to type it.

---

<div class="post-metadata">

**Author:** ![ScottPJones](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/scottpjones/32/146_2.png) [@ScottPJones](https://discourse.julialang.org/u/ScottPJones)\
**Post date:** [January 6, 2017, 4:11pm UTC](https://discourse.julialang.org/t/support-for-displaying-non-identifier-characters-in-help-via-19858/1324/4 "2017-01-06T16:11:07Z")

</div>

Also, please don’t edit the topic into something that had nothing to do with what I’d intended (I just used \dagger as an example, not for any other reason, what I brought up had nothing to do with whether it was an identifier or not - and the error message did not at all indicate that).

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [January 6, 2017, 4:14pm UTC](https://discourse.julialang.org/t/support-for-displaying-non-identifier-characters-in-help-via-19858/1324/5 "2017-01-06T16:14:54Z")

</div>

Sorry, I had to guess at your intent in order to make a clearer title, since the error message was a pre-existing one that had nothing to do with #19858.

---

<div class="post-metadata">

**Author:** ![ScottPJones](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/scottpjones/32/146_2.png) [@ScottPJones](https://discourse.julialang.org/u/ScottPJones)\
**Post date:** [January 6, 2017, 4:19pm UTC](https://discourse.julialang.org/t/support-for-displaying-non-identifier-characters-in-help-via-19858/1324/6 "2017-01-06T16:19:31Z")

</div>

At the time I posted, I had no idea that it had anything to do with identifier vs. non-identifier, or that it was a pre-existing error message. I was just trying to raise the issue that it hadn’t worked as I’d expected. Your now happily merged PRs are very nice additions to Julia, just trying to help out with a bit of user testing!

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [January 6, 2017, 4:24pm UTC](https://discourse.julialang.org/t/support-for-displaying-non-identifier-characters-in-help-via-19858/1324/7 "2017-01-06T16:24:04Z")

</div>

Changing the thread title is not an attack on you, Scott. It’s just that the error is not about what you thought it was about, so a different title clarifies the thread: when something is reported as “error in foo” when it is actually “error in baz”, then a retitle is appropriate, even though the (refocused) discussion remains welcome.

As I said in my initial response, both the help output and the handing of `†` could be improved and your feedback in that regard is welcome.

---

<div class="post-metadata">

**Author:** ![ScottPJones](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/scottpjones/32/146_2.png) [@ScottPJones](https://discourse.julialang.org/u/ScottPJones)\
**Post date:** [January 6, 2017, 4:32pm UTC](https://discourse.julialang.org/t/support-for-displaying-non-identifier-characters-in-help-via-19858/1324/8 "2017-01-06T16:32:26Z")

</div>

No, I didn’t say it was an attack!  
I just think it’s better to leave those alone while things are still unclear, they can be changed if things are clearer later.  
(hopefully the current topic title is clear enough now)  
That’s all!

---

<div class="post-metadata">

**Author:** ![ScottPJones](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/scottpjones/32/146_2.png) [@ScottPJones](https://discourse.julialang.org/u/ScottPJones)\
**Post date:** [January 6, 2017, 4:34pm UTC](https://discourse.julialang.org/t/support-for-displaying-non-identifier-characters-in-help-via-19858/1324/9 "2017-01-06T16:34:41Z")

</div>

I guess maybe _before_ changing a topic title, a message saying: “This seems unclear, did you mean X or Y?” would be nice.

---

<div class="post-metadata">

**Author:** ![ScottPJones](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/scottpjones/32/146_2.png) [@ScottPJones](https://discourse.julialang.org/u/ScottPJones)\
**Post date:** [January 7, 2017, 3:58am UTC](https://discourse.julialang.org/t/support-for-displaying-non-identifier-characters-in-help-via-19858/1324/10 "2017-01-07T03:58:32Z")

</div>

I now have a branch that fixes this (and another related problem), as well as eliminating that unhelpful error message when you ask for help on something that isn’t a valid expression).  
[https://github.com/ScottPJones/julia/tree/spj/improvehelp](https://github.com/ScottPJones/julia/tree/spj/improvehelp)

It turns out that both `repl_latex` (added by #19858) and `repl_search` were being called from the wrong place, in the method `repl(io::IO, s::Symbol)`, after the line after the `?` has already been parsed into an AST (which ended up being `:($(Expr(:error, "invalid character \"†\"")))` with the `dagger` character example).

Could you possibly make a PR from my branch?

Thanks again for doing #19858!
