Skip to content

docs: clarify concat and document string and boolean types - #3745

Merged
gwhitney merged 6 commits into
josdejong:developfrom
Hugohong258:docs/concat-string-signature
Nov 5, 2026
Merged

gwhitney merged 6 commits into
josdejong:developfrom
Hugohong258:docs/concat-string-signature

Conversation

@Hugohong258

@Hugohong258 Hugohong258 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Clarify concat argument groups, dimension numbering, examples, embedded help and history.
  • List concat under Matrix and String with category-appropriate syntax.
  • Add String and Boolean datatype pages and navigation links.

Addresses the documentation portions of #3401. The proposed concatenation operator remains a separate design question. Prepared with AI assistance.

Validation

Windows, Node.js 24.15.0: the latest local full test:all run on 2026-11-04 passed (6,671 source tests, 22 pending; 36 generated-code tests; 298 Node tests; TypeScript phase completed). Lint and build:docs passed. Additional checks covered 46 documentation expressions, 58 local links and 3 documentation category tests. Existing warnings included outdated Browserslist data and JSDoc warnings.

Earlier runs encountered the Node CLI output-order failure documented in the PR history; it was not conclusively attributed. The later local full run passed. The current head d0bd6db, which includes the review revisions and the maintainer's develop merge, has successful build-and-test, Node 20/22/24, lint, coverage and browser checks. Browser tests were run in CI, not locally.

@gwhitney

gwhitney commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Thanks for your ongoing efforts to improve mathjs documentation.

  • you have a test failure
  • My apologies, but the AI did a poor writing job. The expression help is too verbose; in fact it's much longer than the reference page. Both say that "strings are joined in order", but that doesn't seem to add anything to saying that it "concatenates" them. The "two or more" has been dropped, but that was actually useful information. There is a comment about strings not accepting a dimension argument, but the putative dimension argument hasn't even been mentioned so far. And the grammar is wrong; the other parameters don't "accept the dimension argument", it's concat that does or does not accept a final dimension argument, depending on whether the arguments are matrices are strings. Ideally, as long as we are here, we would include some description of what it means to "concatenate along a dimension". The parameter @param description is wrong: it gives the impression that any argument can be an array, matrix, string, number, or bignumber, when in fact the patterns are much more restrictive: either a list of array/matrices optionally followed by a number or bignumber, OR a list of strings. That's it.
  • To sum up, please rewrite by hand to be clearer and more thorough, or if you feel you are not familiar enough with these details, you may also simply close the PR unmerged.
  • If we are going to fix up the doc for concat, it also needs a HISTORY section (see src/expression/parse.js or src/function/arithmetic/gcd.js or many other examples).
  • Finally, it would be nice to address at least a bit more of string concatenation doc issue and questions #3401 while we are at it. If not a dedicated page for the String type (and one for Boolean for completeness), then at least a tweak to the doc generation process to get this function in the String category on https://mathjs.org/docs/reference/functions.html would be helpful. There may be other details of string concatenation doc issue and questions #3401 you'd like to address as well.

@gwhitney
gwhitney marked this pull request as draft November 2, 2026 02:50
@Hugohong258 Hugohong258 changed the title docs: document string arguments for concat docs: clarify concat and document string and boolean types Nov 3, 2026
@Hugohong258

Copy link
Copy Markdown
Contributor Author

These updates were prepared with AI assistance. I have also reviewed the documentation myself, and I have not found any further issues in it.

@gwhitney gwhitney left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

OK, this documentation is really starting to shape up! Thanks so much. Nice job on the HISTORY section.

Are you aware of any further items in issue #3401 that this PR now does not address? I am not saying you have to extend this PR any further -- you've done nice work -- but we just need to be aware of the status of #3401 when this is eventually merged. Thanks.

Comment thread docs/datatypes/booleans.md Resolved
Comment thread docs/datatypes/booleans.md Resolved
Comment thread docs/datatypes/booleans.md Resolved
Comment thread docs/datatypes/booleans.md Resolved
Comment thread docs/datatypes/booleans.md Resolved
Comment thread docs/datatypes/booleans.md Resolved
Comment thread docs/datatypes/strings.md Resolved
Comment thread docs/datatypes/strings.md Resolved
Comment thread src/function/matrix/concat.js Resolved
@gwhitney

gwhitney commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

Thanks for all of your changes; I will do the final checks for merging when you take this PR out of draft status (i.e., hit the "ready for review" button above.

@gwhitney

gwhitney commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

Oh, also please let me know whether you feel this now addresses all points of #3401, or if not, what you feel remains from that issue (not that you need to add anything else to this PR, I'm just looking to be clear on the status of #3401 once this merges).

@Hugohong258
Hugohong258 marked this pull request as ready for review November 5, 2026 00:24
@Hugohong258

Copy link
Copy Markdown
Contributor Author

The documentation changes are ready for review. The broken add/max examples in #3401 were already corrected in de7865c. This PR adds the String and Boolean pages, clarifies concat, lists it in the String reference category, and documents other functions that accept strings.

The remaining question is whether to introduce a dedicated concatenation operator. This PR does not implement one; I understand from Jos's reply that concat(a, b) remains an acceptable solution. I am interested in continuing to contribute to mathjs, including the usolve validation and benchmarking work discussed in #2333.

@gwhitney

gwhitney commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

OK, I opened discussion #3762 for any future conversation about string concatenation operators (you are right, there are no current plans in that direction). Will prepare this PR for merge, and then close #3401. You are welcome to continue contributing to the usolve situation or other open items, thank you.

@gwhitney
gwhitney merged commit 9d9784d into josdejong:develop Nov 5, 2026
8 checks passed
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

Successfully merging this pull request may close these issues.

2 participants