Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
12
Task/Stack/Jq/stack-5.jq
Normal file
12
Task/Stack/Jq/stack-5.jq
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# Input: an object
|
||||
# Output: the updated object with .emit filled in from `update|emit`.
|
||||
# `emit` may produce a stream of values, which need not be strings.
|
||||
def observe(update; emit):
|
||||
def s(stream): reduce stream as $_ (null;
|
||||
if $_ == null then .
|
||||
elif . == null then "\($_)"
|
||||
else . + "\n\($_)"
|
||||
end);
|
||||
.emit as $x
|
||||
| update
|
||||
| .emit = s($x // null, emit);
|
||||
Loading…
Add table
Add a link
Reference in a new issue