Skip to content

Commit 5505d3a

Browse files
bump version and fix warnings and errors (#19)
1 parent 7a75b7d commit 5505d3a

5 files changed

Lines changed: 14 additions & 14 deletions

File tree

.github/workflows/test.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ on:
1313

1414
jobs:
1515
verify_exercises:
16-
# apk has an old nu version, so alpine is used to ensure compatibility
1716
runs-on: ubuntu-24.04
1817

1918
steps:
@@ -22,11 +21,11 @@ jobs:
2221

2322
- name: Use nushell
2423
run: |
25-
curl -L -o nu.tar.gz https://github.com/nushell/nushell/releases/download/0.104.1/nu-0.104.1-x86_64-unknown-linux-gnu.tar.gz && \
24+
curl -L -o nu.tar.gz https://github.com/nushell/nushell/releases/download/0.111.0/nu-0.111.0-x86_64-unknown-linux-gnu.tar.gz && \
2625
tar -xzf nu.tar.gz && \
27-
sudo mv nu-0.104.1-x86_64-unknown-linux-gnu/* /usr/bin/ && \
26+
sudo mv nu-0.111.0-x86_64-unknown-linux-gnu/* /usr/bin/ && \
2827
rm nu.tar.gz && \
29-
rm -r nu-0.104.1-x86_64-unknown-linux-gnu
28+
rm -r nu-0.111.0-x86_64-unknown-linux-gnu
3029
3130
3231
- name: Verify all exercises

exercises/practice/forth/.meta/example.nu

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
alias find = find -n
12
def macro? [item] {
23
let trimmed = ($item | str trim)
34
($trimmed | find --regex "^:\\s+[^\\s]+\\s+.+\\s+;$") == $trimmed
@@ -168,4 +169,4 @@ export def evaluate [instructions: list<string>] {
168169
$stack = perform $stack $norm
169170
}
170171
$stack
171-
}
172+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
def color_code [color] {
22
[black brown red orange yellow green blue violet grey white]
33
| enumerate
4-
| filter {|item| $item.item == $color}
4+
| where $it.item == $color
55
| get index
66
| get 0
77
}
88
export def value [colors] {
99
(color_code $colors.0) * 10 + (color_code $colors.1)
10-
}
10+
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
def color_code [color] {
22
[black brown red orange yellow green blue violet grey white]
33
| enumerate
4-
| filter {|item| $item.item == $color}
4+
| where $it.item == $color
55
| get index
66
| get 0
77
}
@@ -14,13 +14,13 @@ def unit [] {
1414
if $ohms < 1_000 {
1515
$"($ohms) ohms"
1616
} else if $ohms < 1_000_000 {
17-
$"($ohms / 1_000) kiloohms"
17+
$"($ohms // 1_000) kiloohms"
1818
} else if $ohms < 1_000_000_000 {
19-
$"($ohms / 1_000_000) megaohms"
19+
$"($ohms // 1_000_000) megaohms"
2020
} else {
21-
$"($ohms / 1_000_000_000) gigaohms"
21+
$"($ohms // 1_000_000_000) gigaohms"
2222
}
2323
}
2424
export def label [colors] {
2525
(value $colors) * 10 ** ((color_code $colors.2)) | unit
26-
}
26+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export def color_code [color] {
2-
colors | enumerate | filter {|item| $item.item == $color} | get index | get 0
2+
colors | enumerate | where $it.item == $color | get index | get 0
33
}
44

55
export def colors [] {
66
[black brown red orange yellow green blue violet grey white]
7-
}
7+
}

0 commit comments

Comments
 (0)