Created
January 23, 2012 21:34
-
-
Save anonymous/1665643 to your computer and use it in GitHub Desktop.
Method 'a' not found for invocant of class 'Mu'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
role MyAtPos[$s,$i] { | |
method at_pos($j) { | |
Proxy.new: | |
FETCH => method {$s.a[$i][$j]}, | |
STORE => method ($p) { | |
$s.h{ $s.a[$i][$j] } = 0; | |
$s.h{ $p } = [$i, $j]; | |
$s.a[$i][$j]=$p; | |
}; | |
} | |
} | |
method at_pos(Board $s: $i) { | |
Proxy.new: | |
FETCH => method { | |
$s.a[$i] does MyAtPos[$s,$i]; | |
}, | |
STORE => method ($p) {die "Err: Can't assign to an entire row"}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment