Extend notation for Function_Thing
Nobody has claimed this yet.
- Dominant language
- Macaulay2
- Stars
- 435
- Forks
- 297
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 11
Description
Currently if f = (x,y) -> x+y then f_i is essentially y -> i+y:
Function _ Thing := Function => (f,x) -> y -> f splice (x,y)
I suggest we define some sort of simple notation to define:
f(i, _) == y -> i+y
f(_, j) == x -> x+j
It doesn't have to be this exact notation or necessarily involve _, but ideally something simple and clear that we're leaving an input blank and producing a function.
This is helpful for instance in defining a functor F = Hom(M, _).
Roughly speaking, I think the implementation would involve:
- when parsing a comma-separated sequence, if
_is seen, produce a special type of code, sayInputSequence, - define
Function InputSequenceto return a new function.
Another, probably much easier route is to define Function _ Sequence and allow f_(i, null) but that might cause confusion (e.g. what if the first input of f is supposed to be a sequence? or that one of the inputs is really supposed to be null?)
ps: tangentally related to #1630
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how comma-separated sequences are parsed and how Function _ Thing is implemented. Compare the proposed InputSequence approach with the alternative Function _ Sequence and null form. Done means a clear notation is specified and the examples f(i, _) and f(_, j) produce the intended functions without ambiguity.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100