diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2022-03-18 21:22:18 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2022-03-18 21:22:18 -0700 |
commit | aed89b8d355915303ba9424ac01be458becc1f77 (patch) | |
tree | 30838ac582da6ce8ce13008ecc44e51c0062b2f1 /zet.tlv | |
parent | c21cefa8881fbcdbff3206a223cbf58f0e07e5fd (diff) | |
download | teliva-aed89b8d355915303ba9424ac01be458becc1f77.tar.gz |
graphviz: draft notion of nodes in 'focus'
Now the REPL isn't about deciding what to calculate, but just what nodes to calculate it for.
Diffstat (limited to 'zet.tlv')
-rw-r--r-- | zet.tlv | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/zet.tlv b/zet.tlv index 7248970..2d7387b 100644 --- a/zet.tlv +++ b/zet.tlv @@ -165,8 +165,19 @@ >end - __teliva_timestamp: original filter: + >function filter(h, f) + > result = {} + > for k, v in pairs(h) do + > if f(k, v) then + > result[k] = v + > end + > end + > return result + >end +- __teliva_timestamp: original + ifilter: >-- only for arrays - >function filter(l, f) + >function ifilter(l, f) > result = {} > for _, x in ipairs(l) do > if f(x) then |