dgkf / dgkf/R

for loop should *maybe* return `null`

Open
#119 5 comments 0 reactions 0 assignees View on GitHub
meta-discussion type-design
Dominant language
Rust
Stars
145
Forks
5
PR merge metrics
No merged PRs in 30d

Description

This is R's behavior:

```r
> x <- for(i in 1:10) i
> x
NULL
```

This the behavior in the re-implementation:

```r
> x <- for (i in 1:10) i
[1] 10
> x
[1] 10
>
```

I guess nobody uses the return values of for loops anyway, but I think it is more intuitive for *for loops* to return `null` instead of the last evaluation in the last iteration.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.