Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
34 lines (26 sloc) 439 Bytes
define point {
number x, y;
draw { &draw_point; }
}
define line {
point start, end;
draw { &draw_line; }
}
point P, Q
line A, B
constraints {
B.start = (1, 2);
B.end = (3, 4);
A + (10, 10) = B ;
}
__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";
}