Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repl: use pushScope to pass results from --eval -E #860

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sorki
Copy link
Member

@sorki sorki commented Feb 25, 2021

Improve my slopy input prototype from f7704b4.

hnix --repl --eval -E '{ a = 42; }'
hnix> a
42

In a case when argument passed to -E is not an attribute set,
we can't push it to scope directly, so we wrap it
in attribute set under input attribute, like previous version.

hnix --repl --eval -E '42'
hnix> input
42

Related to #292 #172.


This calls for further refactoring and removal of some superfluous code. Tab completion needs to look in current scope as well => Draft.

Improve my slopy `input` prototype from f7704b4.

```
hnix --repl --eval -E '{ a = 42; }'
hnix> a
42
```

In a case when argument passed to `-E` is not an attribute set,
we can't push it to scope directly, so we wrap it
in attribute set under `input` attribute, like previous version.

```
hnix --repl --eval -E '42'
hnix> input
42
```

Related to haskell-nix#292 haskell-nix#172.
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.

1 participant