bazelbuild / bazelbuild/starlark

Specify what happens when builtin methods operate recursively on cyclic structures

Open
#166 0 comments 0 reactions 0 assignees View on GitHub
P4 type: feature request
Dominant language
Python
Stars
3.1k
Forks
178
PR merge metrics
No merged PRs in 30d

Description

Creating a cyclic structure is allowed, even with recursion disabled. But builtin methods can perform their own recursion over a hierarchical structure. We should specify whether implementations are obligated to handle this case gracefully, and whether gracefully means failing, or succeeding with a well-defined behavior, or either.

```
a = []
a.append(a)
print(a) # or str, or repr
```

See also bazelbuild/bazel#4295 for the Java interpreter specifically.

Contributor guide

Open the contributing guide

Research direction

Review how print, str, and repr behave for the cyclic structure in the example, and compare the Java interpreter discussed in bazelbuild/bazel#4295. Resolve whether implementations must handle such recursion and define whether graceful handling means failure, a specified result, or either.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
compilers
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.