Macaulay2 / Macaulay2/M2

No recursion limit error for functions of one argument

Open
#3,495 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Documentation Interpreter
Dominant language
Macaulay2
Stars
435
Forks
297
Avg merge
4d 20h
Merged PRs (30d)
11

Description

Compare the following:

```m2
i1 : f = () -> f();

i2 : g = x -> g x;

i3 : h = (x,y) -> h(x,y);

i4 : i = (x,y,z) -> i (x,y,z);

i5 : f()
stdio:1:11:(3):[301]: error: recursion limit of 300 exceeded

i6 : g 0 -- hangs
C-c C-cstdio:2:11:(3):[1]: error: interrupted

i7 : h(0,0)
stdio:3:14:(3):[301]: error: recursion limit of 300 exceeded

i8 : i(0,0,0)
stdio:4:16:(3):[301]: error: recursion limit of 300 exceeded
```

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

Reproduce the examples in the issue, especially the one-argument function g 0, and compare its behavior with the zero-, two-, and three-argument cases. Trace the interpreter's recursion-limit handling for one-argument function calls; done means g 0 reports the recursion-limit error instead of hanging.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.