package Logic::Let;

use Logic;

use strict;

sub new {
	my ($package, $a, $b) = @_;

	my $self = bless {
		a => $a,
		b => $b,
	}, $package;

	Logic::attach($self, $a, $b);

	return $self;
}

sub activate {
	my ($self) = @_;
	my ($a, $b) = @$self{qw(a b)};

	if (defined $$a) {
		return let $b, $$a;
	}
	if (defined $$b) {
		return let $a, $$b;
	}
	return 0;
}

1
