1. my class ObjAt { # declared in BOOTSTRAP
  2. # class ObjAt is Any
  3. # has str $!value;
  4. method new(str $s) {
  5. nqp::box_s($s, self.WHAT)
  6. }
  7. multi method WHICH(ObjAt:D:) {
  8. nqp::box_s(
  9. nqp::concat(
  10. nqp::if(
  11. nqp::eqaddr(self.WHAT,ObjAt),
  12. 'ObjAt|',
  13. nqp::concat(nqp::unbox_s(self.^name), '|')
  14. ),
  15. $!value
  16. ),
  17. ObjAt
  18. )
  19. }
  20. multi method Str(ObjAt:D:) {
  21. nqp::p6box_s(nqp::unbox_s(self));
  22. }
  23. multi method gist(ObjAt:D:) {
  24. nqp::p6box_s(nqp::unbox_s(self));
  25. }
  26. multi method perl(ObjAt:D:) {
  27. self.^name ~ ".new(" ~ nqp::p6box_s(nqp::unbox_s(self)).perl ~ ")"
  28. }
  29. }