We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3ef4a0c commit 38a6482Copy full SHA for 38a6482
doc/Type/Callable.pod6
@@ -33,9 +33,13 @@ Returns a C<Callable> that implements the same behaviour as the
33
original, but has the values passed to .assuming already bound to the
34
corresponding parameters.
35
36
- sub add(Int $x, Int $y) { $x + $y };
37
- my &add_to_5 = &add.assuming(5);
38
- say add_to_5(4); #-> 9
+ my sub slow($n){ my $i = 0; $i++ while $i < $n; $i };
+
+ # takes only one parameter and as such wont forward $n
39
+ sub bench(&c){ c, now - ENTER now };
40
41
+ say &slow.assuming(10000000).&bench;
42
+ # OUTPUT«(10000000 7.5508834)»
43
44
=comment according to design docs it's Callable but in rakudo it's assuming is in Block
45
0 commit comments