return date from numeric %cw .^

REVIEW %w seems to be used for something else in subscriptions, but
the .^ code was thoroughly stubbed out
This commit is contained in:
Anton Dyudin 2017-12-14 14:03:41 -08:00
parent df66fb7a51
commit 81947a3567

View File

@ -1,3 +1,4 @@
!:
:: clay (4c), revision control
::
:: This is split in three top-level sections: structure definitions, main
@ -44,10 +45,9 @@
:: Type of request.
::
:: %d produces a set of desks, %u checks for existence, %v produces a ++dome of
:: all desk data, %w with a time or label case gets the aeon at that case, %w
:: with a number case is not recommended, %x gets file contents, %y gets a
:: directory listing, and %z gets a recursive hash of the file contents and
:: children.
:: all desk data, %w gets a revision number/date, %x gets file contents,
:: %y gets a directory listing, and %z gets a recursive hash of the file
:: contents and children.
::
:: ++ care ?($d $u $v $w $x $y $z)
::
@ -2102,41 +2102,6 @@
$delta (~(put in $(lob q.q.gar)) lob)
==
::
:: Should be refactored, is only called form `++read`, and even then it
:: can't be called with `$v` as the care, so it's really just a crash.
::
:: To be clear the refactoring should start at ++read-at-aeon and probably
:: eliminate ++read and ++query
::
++ query :: query:ze
|= ren/$?($u $v $x $y $z) :: endpoint query
^- (unit cage)
?- ren
$u !! :: [~ %null [%atom %n] ~]
$v [~ %dome !>(dom)]
$x !! :: ?~(q.ank.dom ~ [~ q.u.q.ank.dom])
$y !! :: [~ %arch !>(as-arch)]
$z !! :: [~ %ankh !>(ank.dom)]
==
::
:: See ++query.
::
++ read :: read:ze
|= mun/mood :: read at point
^- (unit cage)
?: ?=($d p.mun)
~& %dead-d ~
?: ?=($v p.mun)
[~ %dome !>(dom)] :: dead code
?: &(?=($w p.mun) !?=($ud -.q.mun))
?^(r.mun ~ [~ %aeon !>(let.dom)]) :: dead code
?: ?=($w p.mun)
=+ ^= yak
%- aeon-to-yaki
let.dom
?^(r.mun ~ !!) :: [~ %w !>([t.yak (forge-nori yak)])])-all
(query(ank.dom ank:(descend-path:(zu ank.dom) r.mun)) p.mun) :: dead code
::
:: Checks for existence of a node at an aeon.
::
:: This checks for existence of content at the node, and does *not* look
@ -2169,6 +2134,17 @@
~
``[%dome -:!>(*dome) dom]
::
:: Gets the modification date of a node
::
++ read-w
|= {yon/aeon pax/path}
^- (unit (unit {$time (hypo time)}))
?^ pax ~ ::TODO functionality other than %ud -> %da
?: =(0 yon) [~ ~]
%+ bind (~(get by hit.dom) yon)
|= tak=tako
[~ %time -:!>(*time) `time`t:(tako-to-yaki tak)]
::
:: Gets the data at a node.
::
:: If it's in our ankh (current state cache), we can just produce the
@ -2285,8 +2261,10 @@
++ read-at-aeon :: read-at-aeon:ze
|= {yon/aeon mun/mood} :: seek and read
^- (unit (unit (each cage lobe)))
?: &(?=($w p.mun) !?=($ud -.q.mun)) :: NB only her speed
?^(r.mun [~ ~] [~ ~ %& %aeon !>(yon)])
?: ?=($w p.mun)
?^ r.mun [~ ~]
?. ?=($ud -.q.mun) [~ ~ %& %aeon !>(yon)]
(bind (read-w yon r.mun) (lift |=(a/cage [%& a])))
?: ?=($d p.mun)
=+ rom=(~(get by fat.ruf) her)
?~ rom
@ -2313,13 +2291,7 @@
(bind (read-y yon r.mun) (lift |=(a/cage [%& a])))
?: ?=($z p.mun)
(bind (read-z yon r.mun) (lift |=(a/cage [%& a])))
%+ bind
(rewind yon)
|= a/(unit _+>.$)
^- (unit (each cage lobe))
?~ a
~
`(unit (each cage lobe))`(bind (read:u.a mun) |=(a/cage [%& a]))
!!
::
:: Stubbed out, should be removed in the refactoring mentioned in ++query.
::