Still some minor mark, etc, cleanups, and talk.

This commit is contained in:
C. Guy Yarvin 2015-12-10 01:34:00 -08:00
parent 2b4e85c976
commit 05bbab743d
7 changed files with 78 additions and 76 deletions

View File

@ -20,7 +20,7 @@
==
++ react-attrs
~+ ^- (map term cord)
%- mo ^- (list ,[term cord])
%- mo ^- (list {term cord})
:- [%class 'className']
=- (rash - (more next (cook |=(a=tape [(cass a) (crip a)]) (star alf))))
'''
@ -38,16 +38,17 @@
'''
++ react-vale
~(has in react-elems)
::
++ react-to-json
|= src=manx ^- json
?: ?=(_:/(**) src)
|= src+manx ^- json
?: ?=(__(:/(**)) src)
(jape v.i.a.g.src)
=+ atr=(mo a.g.src)
?: (~(has by atr) [%urb %codemirror])
?> ?=([[%pre *] _:/(**) ~] src)
?> ?=({{$pre *} __(:/(**)) $~} src)
$(src ;codemirror(value "{v.i.a.g.i.c.src}");)
?: (~(has by atr) [%urb %exec]) :: runnable code attribute tag
?> ?=([[%pre *] _:/(**) ~] src) :: verify its only a text node
?> ?=({{$pre *} __(:/(**)) $~} src) :: verify its only a text node
=* code v.i.a.g.i.c.src
%_ $
src
@ -56,7 +57,7 @@
=+ claz=?:(-.result "rancode" "failedcode")
;div(class "{claz}")
;pre:"{code}"
;+ ?: ?=(& -.result)
;+ ?: ?=($& -.result)
;code:"{~(ram re (sell p.result))}"
;pre
;div:"error"
@ -70,7 +71,7 @@
c/a/(turn c.src ..$)
gn/s/(mane-to-cord n.g.src)
=< ga/(jobe (turn a.g.src .))
|= [a=mane b=tape] ^- [cord json]
|= {a+mane b+tape} ^- {cord json}
:_ (jape b)
?^ a (mane-to-cord a)
(fall (~(get by react-attrs) a) a)
@ -79,16 +80,16 @@
++ mane-to-cord |=(a=mane `cord`?@(a a (rap 3 -.a ':' +.a ~)))
:: generates React javascript XX deprecated
++ react-to-tape
|= src=manx ^- tape
|= src+manx ^- tape
?: (~(has by (mo a.g.src)) [%urb %codemirror])
?> ?=([[%pre *] _:/(**) ~] src)
?> ?=({{$pre *} __(:/(**)) $~} src)
$(src ;codemirror(value "{v.i.a.g.i.c.src}");)
?: (~(has by (mo a.g.src)) [%urb %exec]) :: runnable code attribute tag
?> ?=([[%pre *] _:/(**) ~] src) :: verify its only a text node
?> ?=({{$pre *} __(:/(**)) $~} src) :: verify its only a text node
=* code v.i.a.g.i.c.src
=+ ^= result
(mule |.((slap !>(.) (ream (crip code))))) :: compile and run safely
?: ?=(%.y -.result) :: it was ok
?: ?=($.y -.result) :: it was ok
=+ ^= new
;div(class "rancode")
;pre:"{code}"
@ -111,18 +112,18 @@
;: weld
"React.createElement("
=* tan n.g.src
?^ tan !! :: namespaces unsupported
?^ tan !! :: namespaces unsupported
?: (react-vale tan)
"'{(trip tan)}'"
(trip tan)
", "
=- (pojo (jobe (turn a.g.src -)))
|= [a=mane b=tape]
|= {a+mane b+tape}
=. a ?+(a a %class 'className')
?^(a !! [a (jape b)])
", "
=< ~(ram re %rose [", " "[" "]"] (turn c.src .))
|= a=manx
|= a+manx
?: ?=(_:/(**) a)
leaf/(pojo (jape v.i.a.g.a))
leaf/^$(src a)

View File

@ -2,10 +2,10 @@
!:
|%
++ extract
|= a=marl ^- tape
|= a+marl ^- tape
?~ a ~
%- weld :_ $(a t.a)
?. ?=(_:/(**) i.a)
?. ?=(__(:/(**)) i.a)
$(a c.i.a)
v.i.a.g.i.a
::
@ -15,48 +15,49 @@
?: (lien tag |=(a=mane =(a n.g.ele)))
~[ele]
(zing (turn c.ele ..$))
++ baff |*([a=(unit) b=(trap)] ?^(a a *b))
::
++ baff |*({a+(unit) b+(trap)} ?^(a a *b))
++ find-in-tree
|* [paz=fist:jo fun=$+(* (unit))]
|= jon=json
|* {paz+fist:jo fun+_+(* (unit))}
|= jon+json
=+ a=`(list json)`~[jon]
|^ (try)
++ try
|. ^+ *fun
?~ a ~
%+ biff (paz i.a)
|* [b=(list json) c=*] ^+ *fun
|* {b+(list json) c+*} ^+ *fun
(baff (baff (fun c) try(a b)) try(a t.a))
--
::
++ map-to-json
|* [a=$+(* cord) b=$+(* json)]
|* {a+_+(* cord) b+_+(* json)}
|* c=(map) ^- json
~! c
(jobe (turn (~(tap by c)) |*([k=* v=*] [(a k) (b v)])))
(jobe (turn (~(tap by c)) |*({k+* v+*} [(a k) (b v)])))
::
++ json-front
|= a=json ^- json
|= a+json ^- json
=- (fall `(unit json)`- ~)
%. a
%+ find-in-tree (ot c/(ar some) gn/so ga/(om so) ~):jo
|= [nom=span atr=(map span cord)] ^- (unit json)
|= {nom+span atr+(map span cord)} ^- (unit json)
?. (~(has by atr) 'urb:front') ~
?> ?=(%meta nom)
?> ?=($meta nom)
(biff (~(get by atr) %value) poja)
::
++ read-schem
=< (cook to-noun (cook to-tree apex))
|%
++ noun $|(term [noun noun]) :: shadow
++ data $|(term [n=@ l=noun r=data])
++ noun _|(term [noun noun]) :: shadow
++ data _|(term {n+@ l+noun r+data})
++ apex ;~(plug sym (star ;~(plug delim sym)))
++ delim ;~(pose (cold 0 dot) (cook lent (plus cab)))
++ to-noun |=(a=data ?@(a a [l.a $(a r.a)]))
++ to-noun |=(a+data ?@(a a [l.a $(a r.a)]))
++ to-tree
|= [acc=data a=(list ,[p=@u q=term])]
|= {acc+data a+(list {p+@u q+term})}
%+ roll a =< .(acc ^acc)
|= [[n=@u v=term] acc=data]
|= {{n+@u v+term} acc+data}
?@ acc [n acc v]
?: (gth n n.acc) [n (to-noun acc) v]
acc(r $(acc r.acc))

View File

@ -16,12 +16,12 @@
%- cu :_ (ar a)
~(gas in *(set __((need *a))))
++ ot
|* a=(pole ,[@tas fist])
|= b=json
|* a+(pole {@tas fist})
|= b+json
%. ((^ot a) b)
%- slog
?+ b ~
[%o *]
{$o *}
%+ murn `(list {@tas fist})`a
|= [c=term d=fist] ^- (unit tank)
=+ (~(get by p.b) c)

View File

@ -11,7 +11,7 @@
++ stage (pair (unit ship) (unit ship)) :: players
++ play (each game tape) :: update
++ game :: game state
$: who=? :: whose turn
_: who=? :: whose turn
sag=stage :: who's playing
aud=(map ship @ud) :: who's watching
box=board :: X board

View File

@ -1,7 +1,7 @@
|-
$: body=json
head=json
snip=json
meta=json
sect=json
_: body+json
head+json
snip+json
meta+json
sect+json
==

View File

@ -1,3 +1,3 @@
$% [%in p=[p=@p q=@t]]
[%out p=[p=@p q=@t]]
_% {$in p+{p+@p q+@t}}
{$out p+{p+@p q+@t}}
==

View File

@ -6,53 +6,53 @@
/- talk
|%
++ client
$: tasks=(map ,@uvH client-task)
sort=(list ,@uvH)
_: tasks+(map @uvH client-task)
sort+(list @uvH)
==
++ client-task
$: archived=_|
audience=(set station:talk)
tax=task
_: archived+__(|)
audience+(set station:talk)
tax+task
==
++ task
$: id=@uvH
date-created=@da
version=@u
date-modified=@da
creator=@p
doer=(unit ,@p)
tags=(set ,@t)
date-due=(unit ,@da)
done=(unit ,@da)
title=@t
description=@t :: XX (list ,@t)
discussion=(list comment)
_: id+@uvH
date-created+@da
version+@u
date-modified+@da
creator+@p
doer+(unit @p)
tags+(set @t)
date-due+(unit @da)
done+(unit @da)
title+@t
description+@t :: XX (list @t)
discussion+(list comment)
==
++ comment
$: date=@da
ship=@p
body=@t :: XX (list ,@t)
_: date+@da
ship+@p
body+@t :: XX (list @t)
==
++ command
$% [%new audience=(set station:talk) task]
[%old id=@uvH dif=update]
[%sort p=(list ,@uvH)]
_% {$new audience+(set station:talk) task}
{$old id+@uvH dif+update}
{$sort p+(list @uvH)}
==
++ update :: XX rename, web-edit?
$% $: %set
$% [%audience to=(set station:talk)]
[%date-due p=(unit ,@da)]
[%title p=@t]
[%description p=@t]
[%tags p=(set ,@t)]
[%done p=?]
_% _: $set
_% {$audience to+(set station:talk)}
{$date-due p+(unit @da)}
{$title p+@t}
{$description p+@t}
{$tags p+(set @t)}
{$done p+?}
== ==
$: %add
$% [%comment @t]
_: $add
_% {$comment @t}
== ==
$: %doer
$% [%release ~]
[%claim ~]
_: $doer
_% {$release $~}
{$claim $~}
== ==
==
--