NB. The queue object template which inherits the print method data =: '' queue_z_ =: monad define ('method' ; 'value') =. 2 take y. if. method match 'type' do. 'queue' elseif. method match 'emptyp' do. 0 = tally data elseif. method match 'enter' do. for_effect_only data =: data , box value elseif. method match 'front' do. if. 0 = tally data do. 'front: queue is empty' else. open first data end. elseif. method match 'remove' do. if. 0 = tally data do. 'remove: queue is empty' else. for_effect_only data =: rest data end. elseif. method match 'size' do. tally data elseif. method match 'print' do. if. 0 = tally data do. 'print: queue is empty' else. for_effect_only display 'front of queue' print 'print' ; box data end. elseif. 1 do. root_object method ; value end. )