Skip to content
Permalink
Browse files

An initial stab at handling <<op=>> faster

  • Loading branch information...
lizmat committed Nov 10, 2018
1 parent a575eff commit c50cf82afc67f1a7c464dad69e4c3d810243e86d
Showing with 10 additions and 4 deletions.
  1. +10 −4 src/core/Hyper.pm6
@@ -1,12 +1,18 @@
# A class to perform hyper operations of the form left op right

class Hyper {
has $.operator; # for some reason we can't make this a &.operator
has int8 $.dwim-left;
has int8 $.dwim-right;
has $.operator; # for some reason we cant make this a &.operator
has int8 $.dwim-left; # left side wont end
has int8 $.dwim-right; # right side wont end
has int8 $.assigns; # assigns to left side

method new(\op, Bool() :$dwim-left, Bool() :$dwim-right) {
self.bless( :operator(op), :$dwim-left, :$dwim-right)
self.bless(
:operator(op),
:$dwim-left,
:$dwim-right,
:assigns(op.name.ends-with("=>")),
)
}

proto method infix(|) {*}

0 comments on commit c50cf82

Please sign in to comment.
You can’t perform that action at this time.