Repository navigation
Add support for missing argument forms and options - #1972
Merged
Merged
Conversation
…sweep
Argument forms:
- Head[expr, h]; Fold[f][x, list]; FromDigits[s, "Roman"]
- Thread[expr, h, spec] with All, None, -n and {m, n, s} position specs
- Partition[list, UpTo[n], d]
- Map/Apply[f, expr, levelspec, Heads -> True|False]
- Do with symbolic bounds of numeric span ({n, x, x + 3 y, y}) and an
Infinity upper bound
- MatrixPower[m, n, v]; ConjugateTranspose[a, perm]; Fit[{m, v}]
- Inner over two expressions with the same non-List head
- DSolve[eqns] / DSolveValue[eqns] reading the unknowns off the derivatives
- NSolve[eqns, vars, dom, prec]; ToBoxes[expr, StandardForm]; DatePlus[n]
- PolyLog[n, p, z] (p = 1 and n = 0 reductions, z-derivative);
EllipticTheta[a, q]; LegendreP[n, m, 1, z]
- RandomInteger with big-integer bounds; RandomColor[RGBColor[_, _, _], n]
- UnitBox/UnitTriangle/HeavisidePi/HeavisideLambda of several variables
and of exact numeric constants (Pi, Sqrt[2]/4)
- DivisorSigma with a symbolic or rational order
- Operator forms KeyExistsQ[k][a], ReplaceList[rules][e],
StringReplacePart[snew, pos][s]; KeyExistsQ of a single rule
- MaximalBy/MinimalBy/TakeLargestBy/TakeSmallestBy[list, f, n, p]
- InverseErf[x0, s]; SquareFreeQ[poly, x]; PowerRange[max];
ParentDirectory[dir, n]; Uncompress[s, h]
- GroupSupport (new) and GroupOrbits[group]
- Inverse trig, Arg, Re, Im, Conjugate at Infinity/ComplexInfinity;
ArcTan[x, y] with one infinite coordinate; KroneckerDelta of nonzero
numeric constants
Options:
- Coefficient/CoefficientList Modulus -> m
- DiagonalMatrix TargetStructure -> "Dense" | "Sparse" | Automatic
Fixes found on the way:
- Sort/Ordering ordering functions answering -1 (Order, NumericalOrder)
now put the second element first
- Compress[Unevaluated[e]] compresses e as written; Uncompress evaluates a
text payload
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016qTZSpPE4Ja7tjbZmw24hT
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements support for numerous missing argument forms and optional parameters discovered through systematic testing of documented examples against the reference implementation.
Summary
Adds comprehensive support for alternative argument forms and optional parameters across 40+ functions, enabling more flexible and powerful usage patterns while maintaining full compatibility with existing code.
Key Changes
Argument Form Expansions:
Head[expr, wrapper]- wraps the head in a specified wrapperThread[expr, h, positions]- threads over specified positions with support for negative indices and rangesPartition[list, UpTo[n], offset]- partitions with variable-length chunks and custom offsetsMap/ApplywithHeads -> True|Falseoption - includes/excludes heads in level-based operationsDowith symbolic bounds and infinite upper bounds - supports symbolic iteration and early terminationFold/FoldListoperator form - curried application with initial valueDSolve/DSolveValuesingle-argument form - automatically extracts unknowns from equationsDatePlus[n]- shorthand forDatePlus[Today, n]PowerRange[max]- shorthand forPowerRange[1, max]ParentDirectory[dir, n]- navigate n levels up the directory treeUncompress[data, wrapper]- wraps decompressed data in a specified headNew Mathematical Functions:
FromDigits[string, "Roman"]- Roman numeral parsingMatrixPower[matrix, n, vector]- matrix power applied to a vectorArcSin[Infinity], etc.)Re[ComplexInfinity], etc.)ArcTanwith infinite coordinatesKroneckerDeltafor non-zero numeric quantitiesCoefficient/CoefficientListwithModulusoptionDiagonalMatrixwithTargetStructure -> "Dense"|"Sparse"optionRandomIntegerfor big integers beyond machine precisionRandomColorwith color templates containing blanksInnerwith general headsConjugateTranspose[matrix, permutation]- permuted conjugate transposeFitwith design matrix formNSolvewith domain and precision argumentsToBoxes[expr, StandardForm]- explicit form specificationPolyLog[n, p, z]with reductions and derivativesEllipticTheta[a, q]- theta constant formLegendreP[n, m, 1, z]- type specification (type 1 is default)UnitBox/UnitTriangle/HeavisideLambdawith exact numeric argumentsDivisorSigma[k, n]with symbolic and rational ordersGroupSupport/GroupOrbitssingle-argument formsMaximalBy/MinimalBy/TakeLargestBy/TakeSmallestBywith ordering functionsInverseErf[a, z]- generalized inverse error functionSquareFreeQ[poly, x]- square-free test with respect to a variableKeyExistsQoperator form and rule supportReplaceListoperator formStringReplacePartoperator formSort/Orderingwith ordering functions (Order,NumericalOrder,Less)PolyLogderivative supportImplementation Details:
{n, x, x+3y, y})https://claude.ai/code/session_016qTZSpPE4Ja7tjbZmw24hT