{"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        method say(*%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));\n$test?.x.say;                           # prints 42\n\nmy $test2 = Point?.null;\n$test2?.x.say;                          # do not print\n\nmy Point? $test3;                       # breaks\n$test3?.x.say;                          # ... \n#       ===SORRY!===\n#       Type 'Point' is not declared\n#       at opt.p6:45\n#       ------> my Point⏏? $test3;\n#       Malformed my\n#       at opt.p6:45\n#       ------> my Point⏏? $test3;\n#","name":"","extension":"txt","url":"https://www.irccloud.com/pastebin/uYLW4MdL","modified":1448305128,"id":"uYLW4MdL","size":1299,"lines":54,"own_paste":false,"theme":"","date":1448305128}