mirror of
https://github.com/nushell/nushell.git
synced 2024-11-24 17:34:00 +01:00
7a888c9e9b
# Description The previous behaviour of `into record` on lists was to create a new record with each list index as the key. This was not very useful for creating meaningful records, though, and most people would end up using commands like `headers` or `transpose` to turn a list of keys and values into a record. This PR changes that instead to do what I think the most ergonomic thing is, and instead: - A list of records is merged into one record. - A list of pairs (two element lists) is folded into a record with the first element of each pair being the key, and the second being the value. The former is just generally more useful than having to use `reduce` with `merge` for such a common operation, and the latter is useful because it means that `$a | zip $b | into record` *just works* in the way that seems most obvious. Example: ```nushell [[foo bar] [baz quux]] | into record # => {foo: bar, baz: quux} [{foo: bar} {baz: quux}] | into record # => {foo: bar, baz: quux} [foo baz] | zip [bar quux] | into record # => {foo: bar, baz: quux} ``` The support for range input has been removed, as it would no longer reflect the treatment of an equivalent list. The following is equivalent to the old behavior, in case that's desired: ``` 0.. | zip [a b c] | into record # => {0: a, 1: b, 2: c} ``` # User-Facing Changes - `into record` changed as described above (breaking) - `into record` no longer supports range input (breaking) # Tests + Formatting Examples changed to match, everything works. Some usage in stdlib and `nu_plugin_nu_example` had to be changed. # After Submitting - [ ] release notes (commands, breaking change) |
||
---|---|---|
.. | ||
nu_plugin_custom_values | ||
nu_plugin_example | ||
nu_plugin_formats | ||
nu_plugin_gstat | ||
nu_plugin_inc | ||
nu_plugin_nu_example | ||
nu_plugin_polars | ||
nu_plugin_python | ||
nu_plugin_query | ||
nu_plugin_stress_internals | ||
nu-cli | ||
nu-cmd-base | ||
nu-cmd-extra | ||
nu-cmd-lang | ||
nu-cmd-plugin | ||
nu-color-config | ||
nu-command | ||
nu-derive-value | ||
nu-engine | ||
nu-explore | ||
nu-glob | ||
nu-json | ||
nu-lsp | ||
nu-parser | ||
nu-path | ||
nu-plugin | ||
nu-plugin-core | ||
nu-plugin-engine | ||
nu-plugin-protocol | ||
nu-plugin-test-support | ||
nu-pretty-hex | ||
nu-protocol | ||
nu-std | ||
nu-system | ||
nu-table | ||
nu-term-grid | ||
nu-test-support | ||
nu-utils | ||
nuon | ||
README.md |
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.