#!hacchpsimguile -b
!#
;; "bool-split-select-a-02.hacchpsimscm"
;;	$Id: bool-split-select-a-02.hacchpsimscm,v 1.2 2007/04/20 18:26:25 fang Exp $
;; vi: ft=scheme
;; @haco@ bool-split-select-a.haco-a

(use-modules (hackt chpsim-primitives))
(use-modules (hackt chpsim))
(use-modules (ice-9 streams))
(use-modules (hackt streams))

(define x all-static-events-stream)

; don't forget cdr, because each event is a paired with its index
(define y (stream-filter (lambda (e) (hac:chpsim-event-trivial? (cdr e))) x))

; show only trivial events (include forks)
"all trivial-events:"
(stream-for-each-display-newline y)
(newline)

(define y (stream-filter (lambda (e) (hac:chpsim-event-fork? (cdr e))) x))
"all fork-events:"
(stream-for-each-display-newline y)
(newline)

(define y (stream-filter (lambda (e) (hac:chpsim-event-wait? (cdr e))) x))
"all wait-events"
(stream-for-each-display-newline y)
(newline)

(define y (stream-filter (lambda (e) (hac:chpsim-event-assign? (cdr e))) x))
"all assign-events:"
(stream-for-each-display-newline y)
(newline)

(define y (stream-filter (lambda (e) (hac:chpsim-event-send? (cdr e))) x))
"all send-events:"
(stream-for-each-display-newline y)
(newline)

(define y (stream-filter (lambda (e) (hac:chpsim-event-receive? (cdr e))) x))
"all receive-events:"
(stream-for-each-display-newline y)
(newline)

(define y (stream-filter (lambda (e) (hac:chpsim-event-select? (cdr e))) x))
"all select-events:"
(stream-for-each-display-newline y)
(newline)

