Skip to content

DUX-5350 Don't eval modules with no eval commands#458

Merged
9999years merged 1 commit into
mainfrom
wiggles/dux-5350/llqy
Jun 15, 2026
Merged

DUX-5350 Don't eval modules with no eval commands#458
9999years merged 1 commit into
mainfrom
wiggles/dux-5350/llqy

Conversation

@9999years

Copy link
Copy Markdown
Member

In #454 I restructured the eval command logic.

Before, the loop looked like this:

for (path, commands) in eval_commands_by_path {
  for command in commands {
    do_eval_command(command);
  }
}

After, I pulled some logic out of the inner loop:

for (path, commands) in eval_commands_by_path {
  do_common_logic(path);
  for command in commands {
    do_eval_command(command);
  }
  finish_common_logic(path);
}

But sometimes commands was empty, doing unnecessary work in the best case and attempting to eval non-Haskell in the worst case!

Let's skip empty entries.

  • Updated the user manual in docs/.
  • Added integration / regression tests in tests/.

In #454 I restructured the eval command logic.

Before, the loop looked like this:

```rust
for (path, commands) in eval_commands_by_path {
  for command in commands {
    do_eval_command(command);
  }
}
```

After, I pulled some logic out of the inner loop:

```rust
for (path, commands) in eval_commands_by_path {
  do_common_logic(path);
  for command in commands {
    do_eval_command(command);
  }
  finish_common_logic(path);
}
```

But sometimes `commands` was empty, doing unnecessary work in the best
case and attempting to eval non-Haskell in the worst case!

Let's skip empty entries.
@linear-code

linear-code Bot commented Jun 15, 2026

Copy link
Copy Markdown

DUX-5350

@9999years 9999years marked this pull request as ready for review June 15, 2026 18:00
@9999years 9999years requested a review from a team as a code owner June 15, 2026 18:00
@9999years 9999years merged commit 560a7fb into main Jun 15, 2026
39 checks passed
@9999years 9999years deleted the wiggles/dux-5350/llqy branch June 15, 2026 18:01
9999years added a commit that referenced this pull request Jun 15, 2026
To actually _execute_ eval commands with the proper bindings in scope,
we need to be able to evaluate (interpret) a file, which requires we
know its module _name_ (because `:module + *MODULE_NAME` only supports
module names and not source paths).

Let's guard adding an entry to the `eval_commands` map by making sure we
can convert the path to a module name.

See also: #458, #454.

- [ ] Updated the user manual in `docs/`.
- [x] Added integration / regression tests in `tests/`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants