Macaulay2 / Macaulay2/M2

Extend notation for Function_Thing

Open
#3,515 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Interpreter
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:

  1. when parsing a comma-separated sequence, if _ is seen, produce a special type of code, say InputSequence,
  2. define Function InputSequence to 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.