Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
35 lines (26 sloc) 433 Bytes
define point {
number x, y;
draw { &draw_point; }
}
define line {
point start, end;
draw { &draw_line; }
}
point P, Q;
line A, B;
constraints {
A + (2,3) = B;
P + (4,5) = Q;
Q = (10, 14);
}
__END__
sub draw_line {
my $env = shift;
my $s = hash2str($env->var_hash);
print "DRAWING LINE ($s)\n";
}
sub draw_point {
my $env = shift;
my $s = hash2str($env->var_hash);
print "DRAWING POINT ($s)\n";
}