mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-02 07:07:46 +00:00
Fix input-output signatures (#999)
Since 0.101.0 we will finally catch more illegal `def` signatures. As the grammar for input/output types is rather restricted, this would error otherwise
This commit is contained in:
parent
be6411ef4a
commit
ba13f5ca60
10 changed files with 15 additions and 15 deletions
|
@ -1,7 +1,7 @@
|
|||
# merge 2 sorted lists
|
||||
|
||||
# Merge 2 sorted lists
|
||||
def merge-2 [l: list, r: list] -> list {
|
||||
def merge-2 [l: list, r: list]: nothing -> list {
|
||||
mut ol = []
|
||||
mut lprime = $l; mut rprime = $r
|
||||
let mx = ($l | length) + ($r | length)
|
||||
|
@ -24,7 +24,7 @@ mut lprime = $l; mut rprime = $r
|
|||
# Merge sort a list
|
||||
# This version is non tail call optimized and might blow the stack for
|
||||
# large lists.
|
||||
def sort-nontail [x: list] -> list {
|
||||
def sort-nontail [x: list]: nothing -> list {
|
||||
let $n = ($x | length)
|
||||
let n_2: int = $n // 2
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue