mirror of
https://github.com/nushell/nushell.git
synced 2025-05-30 06:39:33 +02:00
# Description Close: #12083 Close: #12084 # User-Facing Changes It's a breaking change because we have switched the position of `<initial>` and `<closure>`, after the change, initial value will be optional. So it's possible to do something like this: ```nushell > let f = {|fib = [0, 1]| {out: $fib.0, next: [$fib.1, ($fib.0 + $fib.1)]} } > generate $f | first 5 ╭───┬───╮ │ 0 │ 0 │ │ 1 │ 1 │ │ 2 │ 1 │ │ 3 │ 2 │ │ 4 │ 3 │ ╰───┴───╯ ``` It will also raise error if user don't give initial value, and the closure don't have default parameter. ```nushell ❯ let f = {|fib| {out: $fib.0, next: [$fib.1, ($fib.0 + $fib.1)]} } ❯ generate $f Error: × The initial value is missing ╭─[entry #5:1:1] 1 │ generate $f · ────┬─── · ╰── Missing intial value ╰──── help: Provide <initial> value in generate, or assigning default value to closure parameter ``` # Tests + Formatting Added some test cases. --------- Co-authored-by: Stefan Holderbach <sholderbach@users.noreply.github.com>
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.