new accessors

db4
Doug Coleman 2008-08-30 12:35:14 -05:00
parent e924ee696a
commit 7e5fb8330a
4 changed files with 15 additions and 15 deletions

View File

@ -6,14 +6,14 @@ heaps.private system math math.parser math.order accessors ;
IN: tools.threads
: thread. ( thread -- )
dup thread-id pprint-cell
dup thread-name over [ write-object ] with-cell
dup thread-state [
dup id>> pprint-cell
dup name>> over [ write-object ] with-cell
dup state>> [
[ dup self eq? "running" "yield" ? ] unless*
write
] with-cell
[
thread-sleep-entry [
sleep-entry>> [
key>> millis [-] number>string write
" ms" write
] when*

View File

@ -4,7 +4,7 @@ USING: kernel io io.styles io.files io.encodings.utf8
vocabs.loader vocabs sequences namespaces math.parser arrays
hashtables assocs memoize summary sorting splitting combinators
source-files debugger continuations compiler.errors init
checksums checksums.crc32 sets ;
checksums checksums.crc32 sets accessors ;
IN: tools.vocabs
: vocab-tests-file ( vocab -- path )
@ -61,10 +61,10 @@ SYMBOL: failures
: source-modified? ( path -- ? )
dup source-files get at [
dup source-file-path
dup path>>
dup exists? [
utf8 file-lines crc32 checksum-lines
swap source-file-checksum = not
swap checksum>> = not
] [
2drop f
] if

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license.
USING: concurrency.promises models tools.walker kernel
sequences concurrency.messaging locals continuations
threads namespaces namespaces.private assocs ;
threads namespaces namespaces.private assocs accessors ;
IN: tools.walker.debug
:: test-walker ( quot -- data )
@ -26,6 +26,6 @@ IN: tools.walker.debug
send-synchronous drop
p ?promise
thread-variables walker-continuation swap at
model-value continuation-data
variables>> walker-continuation swap at
model-value data>>
] ;

View File

@ -22,8 +22,8 @@ DEFER: start-walker-thread
: get-walker-thread ( -- status continuation thread )
walker-thread tget [
[ thread-variables walker-status swap at ]
[ thread-variables walker-continuation swap at ]
[ variables>> walker-status swap at ]
[ variables>> walker-continuation swap at ]
[ ] tri
] [
f <model>
@ -43,7 +43,7 @@ DEFER: start-walker-thread
} cond ;
: break ( -- )
continuation callstack over set-continuation-call
continuation callstack >>call
show-walker send-synchronous
after-break ;
@ -248,7 +248,7 @@ SYMBOL: +stopped+
: associate-thread ( walker -- )
walker-thread tset
[ f walker-thread tget send-synchronous drop ]
self set-thread-exit-handler ;
self (>>exit-handler) ;
: start-walker-thread ( status continuation -- thread' )
self [
@ -258,7 +258,7 @@ SYMBOL: +stopped+
V{ } clone walker-history tset
walker-loop
] 3curry
"Walker on " self thread-name append spawn
"Walker on " self name>> append spawn
[ associate-thread ] keep ;
! For convenience