Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

documentation syntax examples are different than actual results #279

Closed
xoich opened this issue Aug 25, 2023 · 6 comments
Closed

documentation syntax examples are different than actual results #279

xoich opened this issue Aug 25, 2023 · 6 comments

Comments

@xoich
Copy link
Contributor

xoich commented Aug 25, 2023

in the section BACKSLASH SUBSTITUTION it says

set \*a \\{foo
The first argument to set will be \*a and the second argument will be {foo.

But it seems the variable will be called *a and the result is \{foo

It later says:

set a {{abc}
the second argument to set will be {abc.

But the opening brace is never closed, so that is an incomplete tcl command

@msteveb
Copy link
Owner

msteveb commented Aug 25, 2023

Yes, that doesn't look right. How is this?

If a backslash is followed by something other than one of the options described above,
then the backslash is dropped and the following character is treated as an ordinary character
without any special processing. For example, in the command

    set \*a \{foo

The first argument to set will be *a and the second argument will be {foo.

If an argument is enclosed in braces, then backslash sequences inside the argument
are parsed but no substitution occurs (except for backslash-newline): the backslash sequence
is passed through to the argument as is, without making any special interpretation of the
characters in the backslash sequence. In particular, backslashed braces are not counted
in locating the matching right brace that terminates the argument. For example, in the command

    set a {\{abc}

the second argument to set will be \{abc.

@xoich
Copy link
Contributor Author

xoich commented Aug 25, 2023

yes it looks right now. There seems to be a problem with escaping in the manual source. By the way, what format is the manual and how is it compiled? Thank you

@msteveb
Copy link
Owner

msteveb commented Aug 25, 2023

It's asciidoc. You can see how it is built in the Makefile here:

Tcl.html: jim_tcl.txt ./make-index
    /usr/local/bin/jimsh ./make-index $> $^ | asciidoc --attribute footer-style=none -d manpage - >$@

Yes, backslashes are very troublesome

@xoich
Copy link
Contributor Author

xoich commented Aug 25, 2023

thanks. By the way, I really like the way that this man page succinctly explains the basics of Tcl. I wonder if it would be an idea to include it or point to it in the manual.

@msteveb
Copy link
Owner

msteveb commented Aug 25, 2023

Possibly, but where to stop? And how to keep them in sync (if external links go away or change)?
I'm open to anyone who wants to help improve the documentation.

@msteveb
Copy link
Owner

msteveb commented Aug 27, 2023

Fixed in #280

@msteveb msteveb closed this as completed Aug 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants