Skip to content

Commit

Permalink
Activate the Hyper refactor
Browse files Browse the repository at this point in the history
- in the simplest way, by taking over the HYPER proto
- makes simple cases such @A <<+>> @A, @A <<+ 42 between 1.4x and 1.8x as fast
- more complicated cases benefit more from needing to pass fewer parameters
- no other code is removed yet: this is yet to come
  • Loading branch information
lizmat committed Nov 9, 2018
1 parent ec2848c commit f06e858
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/metaops.pm6
Expand Up @@ -522,7 +522,9 @@ sub METAOP_HYPER_PREFIX(\op) {


sub METAOP_HYPER_CALL(\list, |args) { deepmap(-> $c { $c(|args) }, list) } sub METAOP_HYPER_CALL(\list, |args) { deepmap(-> $c { $c(|args) }, list) }


proto sub HYPER(|) {*} proto sub HYPER(\operator, :$dwim-left, :$dwim-right, |c) {
Hyper.new(operator, :$dwim-left, :$dwim-right).infix(|c)
}


multi sub HYPER(&op, \left, \right, :$dwim-left, :$dwim-right) { multi sub HYPER(&op, \left, \right, :$dwim-left, :$dwim-right) {
op(left, right); op(left, right);
Expand Down

0 comments on commit f06e858

Please sign in to comment.