Skip to content

Instantly share code, notes, and snippets.

@colomon
Created October 5, 2010 01:35
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save colomon/610804 to your computer and use it in GitHub Desktop.
Works:
(1 ..^ +@.points).grep({
my $range = (@.points[$_ - 1][0] minmax @.points[$_][0]);
$u ~~ $range;
}).map({ self.intersection-info($_, $u); });
Doesn't work:
(1 ..^ +@.points).grep({
$u ~~ (@.points[$_ - 1][0] minmax @.points[$_][0]);
}).map({ self.intersection-info($_, $u); });
trace:
Cannot modify readonly value
in '&infix:<=>' at line 1
in <anon> at line 1698:CORE.setting # this is at_pos
in '&infix:<=>' at line 1
in <anon> at line 1532:CORE.setting # this is Any.minmax
in 'Any::minmax' at line 1
in 'infix:<minmax>' at line 596:CORE.setting
in <anon> at line 183:lib/loop.pm
in 'Block::ACCEPTS' at line 5912:CORE.setting
in <anon> at line 1442:CORE.setting
in <anon> at line 1
in main program body at line 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment