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

RFC: Document the rationale behind * for strings #19643

Merged
merged 2 commits into from
Dec 20, 2016

Conversation

ararslan
Copy link
Member

I figured as long as * is used for string concatenation, we should be transparent about why it's used for string concatenation. Currently it's not even mentioned in the manual, only in the standard library documentation. This PR adds a subsection on concatenation to the Strings section of the manual. In it I've tried to express why * isn't just some arbitrary choice. In its current form, the text here was built collaboratively by @Sacha0 and me. Any comments are quite welcome.

As an aside, since this only touches a Markdown file in the manual source, I've skipped CI. If CI should not have been skipped then let me know and I can undo that.

cc @stevengj and @StefanKarpinski

Copy link
Member

@MichaelHatherly MichaelHatherly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As an aside, since this only touches a Markdown file in the manual source, I've skipped CI. If CI should not have been skipped then let me know and I can undo that.

skip ci will skip building and deploying any docs changes, so that should be removed.

as in Perl:
Julia also provides `*` for string concatenation:

```julia
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably worth starting to re-add jldoctests when new examples are added; it can be done bit by bit for anything in manual/. Since this one uses variables from the above block you'll need to use named blocks, i.e.

```jldoctest my-name-here

to share a namespace between each code block.

Copy link
Member Author

@ararslan ararslan Dec 19, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I've changed the string concatenation code blocks to jldoctests under a single namespace. Thanks! (And I've not added [ci skip] to this commit in order to trigger CI. The text in the previous commit can be removed on squash-merge.)

@ViralBShah
Copy link
Member

This is really nice!

@nalimilan
Copy link
Member

I wish you had spent your valuable time introducing another operator (like ++) instead... ;-)

@kshyatt kshyatt added docs This change adds or pertains to documentation strings "Strings!" labels Dec 19, 2016
@stevengj stevengj merged commit 194e4c9 into JuliaLang:master Dec 20, 2016
@ararslan ararslan deleted the aa/concat-doc branch December 20, 2016 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change adds or pertains to documentation strings "Strings!"
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants