Changed . token to _dot

This change allows the dotfiles to work with chezmoi (e.g: on windows)
and improves grepability with neovim/telescope
This commit is contained in:
2024-11-07 13:52:17 +00:00
parent 83b02bd753
commit 896af887ca
2351 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
# Mutually recursive versions of even and odd commands
# even returns true if passed in 0. odd returns returns true if passed in 1
# Else, they subtract 2 and call the other fn: even calls odd ($n - 2)
#
# These functions are meant to be used with the tramp module which implements
# a trampoline wrapper closure. Thus, for each even, odd command, the
# normal recursive case will actually return a thunk..
# Return true if number is even. Calls mutually recursive odd function
# if number is greater than 1.
def even [n: int, acc=true] -> any {
if $n == 0 { return $acc } else if $n == 1 {
return (not $acc) } else {
{|| odd ($n - 2) (not $acc) }
}
}
# Returns true if number is odd. Will cooperate with even in a mutually recursive fashion.
# Warning: do not pass any numbers less than 0
def odd [n: int, acc=true] -> bool {
if $n == 0 { return (not $acc) } else if $n == 1 {
return $acc } else {
{|| even ($n - 2) (not $acc) }
}
}