You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can we have functionality to record history and retrieve it. E.g.
x = Signal(0)
xhist = history(skip(1, x), 10)
sma10 = skip(10, xhist) do a
foldp(0, a) do b
if len(b) >= 10
return (last(b, 1) - last(b, 10)) / 10
elseif
return last(b, 1) / 10
end
0
end
end
Basicall what functions to deal with history:
history - record n historic values
last - retrieve ith historic value.
last - retrieve ith historic value. If a default is specified return the default value if not full.
skip - skip n initial values
take - takes only 1st n initial value and none after
The text was updated successfully, but these errors were encountered:
Actually you can make the record of a signal be a signal. For example, suppose x is a signal of number and X is a signal of vector which stores all the values of x, every time x is updated, X is updated correspondingly. Making all the things recordable is a waste of space and time, so I think explicitly recording things may be better if it is needed.
Can we have functionality to record history and retrieve it. E.g.
Basicall what functions to deal with history:
The text was updated successfully, but these errors were encountered: