urbit/main/bin/room.hoon

180 lines
5.1 KiB
Plaintext
Raw Normal View History

2013-10-30 22:26:51 +04:00
!:
:: /=main=/bin/room/hoon
::
=> %= .
+
=> +
=> ^/===/lib/pony
=> ^/===/lib/chat
=> |%
++ fool
$: num=@ud :: number received
nym=@t :: text name
sec=sect :: banner
liv=? :: officially live
elf=@da :: last ping
== ::
++ loft ::
$: num=@ud :: (lent meg)
meg=(list zong) :: messages backward
pod=(map ,@p fool) :: individual status
== ::
2013-11-03 05:29:28 +04:00
++ chub (list ,[p=@p q=(list zong)]) :: delivery report
2013-10-30 22:26:51 +04:00
-- ::
|%
++ fu
|_ [now=@da lov=loft]
++ of
|_ [her=@p ful=fool]
++ abet ..of(pod.lov (~(put by pod.lov) her ful))
2013-11-03 05:29:28 +04:00
++ call [her nym.ful]
2013-10-30 22:26:51 +04:00
++ push
2013-11-03 05:29:28 +04:00
^- [(list zong) _.]
?. liv.ful [~ .]
:- %- flop
2013-10-30 22:26:51 +04:00
%+ skim (scag (sub num.lov num.ful) meg.lov)
|= a=zong
?. ?=(%all -.a) &
&(!=(her p.q.a) |(=(%white p.a) =(sec.ful p.a)))
.(num.ful num.lov)
--
::
++ rolf
2013-11-03 05:29:28 +04:00
^- [chub _.]
=^ zal pod.lov
%+ ~(rib by pod.lov) *chub
|= [[her=@p ful=fool] fug=chub]
^- [chub [@p fool]]
2013-10-30 22:26:51 +04:00
=+ lol=~(push of her ful)
2013-11-03 05:29:28 +04:00
[[[her -.lol] fug] [her ful.+.lol]]
2013-10-30 22:26:51 +04:00
[zal +]
::
2013-11-03 05:29:28 +04:00
++ tell
|= zog=(list zong)
^+ +>
%= +>
num.lov (add (lent zog) num.lov)
meg.lov (weld (flop zog) meg.lov)
2013-10-30 22:26:51 +04:00
==
::
2013-11-03 05:29:28 +04:00
++ tilt
|= zew=(list zong)
=. +>.$ (tell zew)
=^ yeq +>.$ rolf
[yeq lov]
::
++ wake
^- [chub loft]
=^ zew pod.lov
%+ ~(rib by pod.lov) *(list zong)
|= [[her=@p ful=fool] fug=(list zong)]
^- [(list zong) [@p fool]]
?. &(liv.ful (gth now (add ~m2 elf.ful))) [fug her ful]
[[`zong`[%out [her nym.ful]] fug] [her ful(liv |)]]
(tilt zew)
::
2013-10-30 22:26:51 +04:00
++ yelp
|= [her=@p zig=zing]
2013-11-03 05:29:28 +04:00
^- [chub loft]
?: ?=(%who -.zig)
2013-10-30 22:26:51 +04:00
:_ lov
2013-11-03 05:29:28 +04:00
:~ :- her
:~ :- %who
^- (list user)
=< -
%+ ~(rib by pod.lov) *(list user)
|= [[her=@p ful=fool] fug=(list user)]
^- [(list user) [@p fool]]
:_ [her ful]
?. liv.ful fug
[[her nym.ful] fug]
==
==
=+ pof=(yowl her)
=^ zew +>.$
?- -.zig
%all
:_ abet:pof
[[%all ?:(p.zig %white sec.ful.pof) call:pof q.zig] ~]
::
%ego
:_ abet:pof(liv.ful &, elf.ful now)
2013-11-03 05:29:28 +04:00
=. elf.ful.pof now
?:(liv.ful.pof ~ [[%new call:pof] ~])
::
%out
:_ abet:pof(liv.ful |)
?.(liv.ful.pof ~ [[%out call:pof] ~])
==
(tilt zew)
::
++ yowl
|= her=@p
^+ of
=+ nog=(~(get by pod.lov) her)
=+ ^= ful ^- fool
?^ nog u.nog
=+ ^= gos
%- (hard (unit gcos))
.^(%a (scot %p her) %gcos (scot %da now) ~)
^- fool
:* 0
(numb her now)
^- sect
?. &(?=(^ gos) ?=(%duke -.u.gos)) %white
?.(?=(?(%lord %lady) -.p.u.gos) %white r.p.p.u.gos)
&
now
==
~(. of her ful)
2013-10-30 22:26:51 +04:00
--
--
==
=> %= .
-
2013-11-03 05:29:28 +04:00
:- :* lov=*loft
wak=@da
==
2013-10-30 22:26:51 +04:00
[who=`@p`-< how=`path`->]
==
|= [est=time *]
|= ~
=. wak est
2013-11-03 05:29:28 +04:00
=< `bowl`[~ ~ hope vent]
|%
++ cede
|= cub=chub
^- (list gift)
(turn cub |=([a=@p b=(list zong)] [%sq a %oy /re b]))
::
++ hope
^- (list slip)
:~ [/yo [%lq %yo]]
[/wa [%wa wak]]
[/re [%ow ~]]
==
::
++ take
|- ^- [chub _+]
=^ cub lov ~(wake fu est lov)
[cub +.$]
::
++ talk
|= [her=@p zig=zing]
^- [chub _+>]
=^ cub lov (~(yelp fu est lov) her zig)
[cub +>.$]
::
++ vent
|= [now=@da pax=path nut=note]
^- bowl
=. est now
=^ cub +>
?+ pax !!
/re ?>(?=(%ow -.nut) [~ +>])
/wa ?>(?=(%wa -.nut) take(wak (add ~m1 est)))
/yo ?>(?=(%lq -.nut) (talk p.nut ((hard zing) r.nut)))
2013-10-30 22:26:51 +04:00
==
2013-11-03 05:29:28 +04:00
[(cede cub) ~ hope ..$]
--