carpentry-org / carpentry-org/dimensions

src/dimensional.carp: `transpose` captures `i` (closure error blocks all tests)

Open
#11 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Makefile
Stars
3
Forks
1
PR merge metrics
No merged PRs in 30d

Description

All four tests under `test/` fail to compile with:

```
Can't give away the captured value 'i' at line 33, column 69 in 'src/dimensional.carp'. Captured values can be borrowed with `&` or copied with `@&`, not moved.
```

The offending form:

```carp
(defn transpose [f]
(tabulate &(fn [i] (smap &(fn [x] ((lookup x) i)) f))))
```

The inner closure captures `i` by move when it needs to be borrowed (`&i`) or copied (`@&i`).

The test runner (`test-all.sh`) doesn't propagate `carp -x` exit codes through the loop, so the failure has been silently swallowed in CI.

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.