Merge branch 'master' of git://factorcode.org/git/factor
commit
0558df4875
|
@ -11,13 +11,11 @@ link-no-follow? off
|
||||||
[ "Baz" ] [ "Baz" simple-link-title ] unit-test
|
[ "Baz" ] [ "Baz" simple-link-title ] unit-test
|
||||||
|
|
||||||
[ ] [
|
[ ] [
|
||||||
"abcd-*strong*\nasdifj\nweouh23ouh23"
|
"abcd-*strong*\nasdifj\nweouh23ouh23" parse-farkup drop
|
||||||
"paragraph" \ farkup rule parse drop
|
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
[ ] [
|
[ ] [
|
||||||
"abcd-*strong*\nasdifj\nweouh23ouh23\n"
|
"abcd-*strong*\nasdifj\nweouh23ouh23\n" parse-farkup drop
|
||||||
"paragraph" \ farkup rule parse drop
|
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
[ "<p>a-b</p>" ] [ "a-b" convert-farkup ] unit-test
|
[ "<p>a-b</p>" ] [ "a-b" convert-farkup ] unit-test
|
||||||
|
|
|
@ -91,8 +91,6 @@ SYMBOL: current-irc-client
|
||||||
: irc-send ( irc-message -- ) irc> out-messages>> mailbox-put ;
|
: irc-send ( irc-message -- ) irc> out-messages>> mailbox-put ;
|
||||||
: listener> ( name -- listener/f ) irc> listeners>> at ;
|
: listener> ( name -- listener/f ) irc> listeners>> at ;
|
||||||
|
|
||||||
: maybe-mailbox-get ( mailbox quot: ( irc-message -- ) -- )
|
|
||||||
[ dup mailbox-empty? [ drop 0.1 sleep ] ] dip '[ mailbox-get @ ] if ; inline
|
|
||||||
|
|
||||||
GENERIC: to-listener ( message obj -- )
|
GENERIC: to-listener ( message obj -- )
|
||||||
|
|
||||||
|
@ -294,14 +292,14 @@ DEFER: (connect-irc)
|
||||||
[ (reader-loop) ] [ handle-disconnect ] recover t ;
|
[ (reader-loop) ] [ handle-disconnect ] recover t ;
|
||||||
|
|
||||||
: writer-loop ( -- ? )
|
: writer-loop ( -- ? )
|
||||||
irc> out-messages>> [ handle-outgoing-irc ] maybe-mailbox-get t ;
|
irc> out-messages>> mailbox-get handle-outgoing-irc t ;
|
||||||
|
|
||||||
! ======================================
|
! ======================================
|
||||||
! Processing loops
|
! Processing loops
|
||||||
! ======================================
|
! ======================================
|
||||||
|
|
||||||
: in-multiplexer-loop ( -- ? )
|
: in-multiplexer-loop ( -- ? )
|
||||||
irc> in-messages>> [ handle-incoming-irc ] maybe-mailbox-get t ;
|
irc> in-messages>> mailbox-get handle-incoming-irc t ;
|
||||||
|
|
||||||
: strings>privmsg ( name string -- privmsg )
|
: strings>privmsg ( name string -- privmsg )
|
||||||
privmsg new [ (>>trailing) ] keep [ (>>name) ] keep ;
|
privmsg new [ (>>trailing) ] keep [ (>>name) ] keep ;
|
||||||
|
@ -314,9 +312,10 @@ DEFER: (connect-irc)
|
||||||
|
|
||||||
: listener-loop ( name -- ? )
|
: listener-loop ( name -- ? )
|
||||||
dup listener> [
|
dup listener> [
|
||||||
out-messages>> [ maybe-annotate-with-name
|
out-messages>> mailbox-get
|
||||||
irc> out-messages>> mailbox-put ] with
|
maybe-annotate-with-name
|
||||||
maybe-mailbox-get t
|
irc> out-messages>> mailbox-put
|
||||||
|
t
|
||||||
] [ drop f ] if* ;
|
] [ drop f ] if* ;
|
||||||
|
|
||||||
: spawn-irc-loop ( quot: ( -- ? ) name -- )
|
: spawn-irc-loop ( quot: ( -- ? ) name -- )
|
||||||
|
|
Loading…
Reference in New Issue