view arrows/alatch.m @ 61:eff6bddf82e3 tip

Finally implemented perceptual brightness thing.
author samer
date Sun, 11 Oct 2015 10:20:42 +0100
parents ae596261e75f
children
line wrap: on
line source
% alatch - Arrow which produces the value in the last event received.
%
% alatch :: A -> arrow( {box(A)}, {A}, A).
function o=alatch(x0)
	o=loop(@upd,@(sz)x0);
end

function [y,s]=upd(x,s)
	if iscell(x) && ~isempty(x), s=x{end}; end
	y=s;
end