Hello,

A problem with the listener mod I shared yesterday is that the stack display 
and stdio output get run together. You can't tell where the output ends and 
where the stack display begins. This mod fixes that problem. In addition, 
I've also added the retain stack to the display. Lastly, you can turn off the 
stack display with stack-display-off and turn it back on with 
stack-display-on. I have this code in a file called "listener-mod.factor". To 
enable the mod you should be able to just run-file it.

Ed

! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
USING: kernel errors io namespaces tools ;

IN: listener

SYMBOL: stack-display

: stack-display-on ( -- ) stack-display on ;

: stack-display-off ( -- ) stack-display off ;

: (print-stacks) ( -- ) "----------\n" write .s "----------\n" write .r ;

: print-stacks ( -- ) stack-display get [ (print-stacks) ] when ;

: listen ( -- ) 
[ stdio get parse-interactive [ call print-stacks ] [ bye ] if* ] try ;

stack-display-on
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to