Skip to content

Commit

Permalink
Cleanup dev/snippets.jq
Browse files Browse the repository at this point in the history
  • Loading branch information
wader committed Sep 12, 2021
1 parent 22eb53d commit 9797cdc
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions dev/snippets.jq
Original file line number Diff line number Diff line change
Expand Up @@ -70,32 +70,3 @@ def duration:
if . | type == "string" then _string
elif . | type == "number" then _number
else error("expected string or number") end;

# def recurse_foreach(init; update; extract):
# def _recurse_foreach($state; $c):
# (. as $c | ["_recurse_foreach $state", $state] | debug | $c) |
# (. as $b | ["_recurse_foreach $c", $c] | debug | $b) |
# foreach $c[]? as $e (
# $state
# ;
# (. as $c | ["update $state", $state] | debug | $c) |
# (. as $b | ["update $e", $e] | debug | $b) |
# null | _recurse_foreach({state: $state, e: $e} | update; $e)
# ;
# (. as $c | ["extract $state", $state] | debug | $c) |
# (. as $b | ["extract $e", $e] | debug | $b) |
# {state: $state, e: .} |
# extract
# )
# // $c;
# _recurse_foreach(init; .);

# # TODO: split? can't really switch on type
# def grep(f):
# if f | type == "string" then
# .. | select((._name | contains(f)) or (contains(f)? // false))
# elif f | type == "number" then
# .. | select(. == f)
# else
# .. | debug | select(f)?
# end;

0 comments on commit 9797cdc

Please sign in to comment.