nushell/crates
JT b70cce47e2
disallow blocks as first-class values (#9587)
# Description

This PR disallows blocks as first-class values by removing the ability
to create them using the `block` syntax shape or type. Now, the parser
will only ever be able to create closures as first-class values.

This means that `{ 3 }` will always be treated as a closure, unless used
in the specifically supported use case of the literal being given as an
arg to `for`, `if` and other built-in block users.

Note: first-class value here means "value that can be passed into
commands and held in variables"

# User-Facing Changes

This may break some user scripts as `: block` is no longer allows as a
type annotation. Note: these cases were not actually supported before,
as, for example, passing a block that accessed a variable would have
errored when the block was later evaluated.

Closures do not have the restriction mentioned above and are the much
safer value to pass as first-class, so now they are the only block-like
value to be allowed to be passed.

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect -A clippy::result_large_err` to check that
you're using the standard code style
- `cargo test --workspace` to check that all tests pass
- `cargo run -- crates/nu-std/tests/run.nu` to run the tests for the
standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
2023-07-03 07:40:56 +12:00
..
nu_plugin_custom_values Bump to 0.82.1 dev version (#9543) 2023-06-27 21:33:53 +02:00
nu_plugin_example Bump to 0.82.1 dev version (#9543) 2023-06-27 21:33:53 +02:00
nu_plugin_formats Bump to 0.82.1 dev version (#9543) 2023-06-27 21:33:53 +02:00
nu_plugin_gstat Bump to 0.82.1 dev version (#9543) 2023-06-27 21:33:53 +02:00
nu_plugin_inc Bump to 0.82.1 dev version (#9543) 2023-06-27 21:33:53 +02:00
nu_plugin_python update nu_plugin_python due to signature changes (#8107) 2023-02-18 13:27:24 +00:00
nu_plugin_query Bump to 0.82.1 dev version (#9543) 2023-06-27 21:33:53 +02:00
nu-cli Bracketed paste refactor (#9547) 2023-07-02 14:11:12 -05:00
nu-cmd-base Bump to 0.82.1 dev version (#9543) 2023-06-27 21:33:53 +02:00
nu-cmd-dataframe Improve type hovers (#9515) 2023-06-29 05:19:48 +12:00
nu-cmd-extra convert a string to a raw binary string of 0s and 1s (#9534) 2023-06-28 13:04:07 -05:00
nu-cmd-lang remove let-env, focus on mutating $env (#9574) 2023-07-01 07:57:51 +12:00
nu-color-config remove let-env, focus on mutating $env (#9574) 2023-07-01 07:57:51 +12:00
nu-command fix typo in deprecated message: $nu should be $env (#9579) 2023-07-01 17:55:25 +02:00
nu-engine remove let-env, focus on mutating $env (#9574) 2023-07-01 07:57:51 +12:00
nu-explore Bump to 0.82.1 dev version (#9543) 2023-06-27 21:33:53 +02:00
nu-glob Bump to 0.82.1 dev version (#9543) 2023-06-27 21:33:53 +02:00
nu-json Bump to 0.82.1 dev version (#9543) 2023-06-27 21:33:53 +02:00
nu-parser disallow blocks as first-class values (#9587) 2023-07-03 07:40:56 +12:00
nu-path Bump to 0.82.1 dev version (#9543) 2023-06-27 21:33:53 +02:00
nu-plugin Improve type hovers (#9515) 2023-06-29 05:19:48 +12:00
nu-pretty-hex Bump to 0.82.1 dev version (#9543) 2023-06-27 21:33:53 +02:00
nu-protocol fix a few clippy issues (#9578) 2023-07-01 19:52:04 +12:00
nu-std Implement annotations support in test runner (#9406) 2023-07-02 10:41:33 +02:00
nu-system Bump to 0.82.1 dev version (#9543) 2023-06-27 21:33:53 +02:00
nu-table Fix #9548 (#9552) 2023-06-28 17:52:04 -05:00
nu-term-grid Bump to 0.82.1 dev version (#9543) 2023-06-27 21:33:53 +02:00
nu-test-support Bump to 0.82.1 dev version (#9543) 2023-06-27 21:33:53 +02:00
nu-utils use an easier-to-read date format in prompt (#9585) 2023-07-02 20:25:22 +12:00
README.md Remove old nushell/merge engine-q 2022-02-07 14:54:06 -05:00

Nushell core libraries and plugins

These sub-crates form both the foundation for Nu and a set of plugins which extend Nu with additional functionality.

Foundational libraries are split into two kinds of crates:

  • Core crates - those crates that work together to build the Nushell language engine
  • Support crates - a set of crates that support the engine with additional features like JSON support, ANSI support, and more.

Plugins are likewise also split into two types:

  • Core plugins - plugins that provide part of the default experience of Nu, including access to the system properties, processes, and web-connectivity features.
  • Extra plugins - these plugins run a wide range of different capabilities like working with different file types, charting, viewing binary data, and more.