{"body":"class OptionalObj {...}\nclass Optional {\n        has $.type;\n        method __instanciate(Mu:U $type) {\n                self.bless(:$type)\n        }\n        method new(*%h, *@a){\n                OptionalObj.new(:instance($.type.new(|%h, |@a)))\n        };\n        method FALLBACK(Str $meth, *%h, *@a) {\n                $.type.$meth(|%h, |@a)\n        }\n        method null() {\n                OptionalObj.new(:instance(Nil))\n        }\n}\nclass OptionalObj {\n        has $.instance;\n        method FALLBACK(Str $meth, *%h, *@a) {\n                self but False\n        }\n}\nmulti sub postfix:<?>(Mu:U $type) {\n   Optional.__instanciate($type)\n}\n\nmulti sub postfix:<?>(OptionalObj $obj) {\n   $obj.instance || $obj\n}\n\nclass Point {\n        has $.x;\n        has $.y;\n}\n\nmy $test = Point?.new(:x(42), :y(43));\nif my $p = $test?.x {\n        $p.say;\n}\n\nmy $test2 = Set?.null;\nif my $q = $test2?.x {\n        $q.say;\n}","name":"","extension":"pl","url":"https://www.irccloud.com/pastebin/TY9qyRud","modified":1448298885,"id":"TY9qyRud","size":905,"lines":44,"own_paste":false,"theme":"","date":1448298885}