Paste: rs flipflop

Author: kenanb
Mode: factor
Date: Wed, 27 Apr 2011 03:24:16
Plain Text |
SYMBOL: Q1
SYMBOL: Q2
DEFER: fn2
TUPLE: flipflop value { transmitted? initial: f } ;

: fn1 ( tuple -- ) [ [ drop 1 ] change-value value>> Q1 set ] [ dup transmitted?>> [ drop ] [ [ drop t ] change-transmitted? fn2 ] if ] bi ; inline recursive

: fn2 ( tuple -- ) [ [ drop 0 ] change-value value>> Q2 set ] [ dup transmitted?>> [ drop ] [ [ drop t ] change-transmitted? fn1 ] if ] bi ; inline recursive

New Annotation

Summary:
Author:
Mode:
Body: