1. # This file contains various stubs. Note that a few are created already
  2. # outside of the setting, such as Mu/Any/Cool, Attribute, Signature/Parameter,
  3. # Code/Block/Routine/Sub/Method and Str/Int/Num. They are built in BOOTSTRAP.pm
  4. # in Perl6::Metamodel for now, though should be a BEGIN block in CORE.setting
  5. # in the end.
  6. my class Exception { ... }
  7. my class X::AdHoc { ... }
  8. my class FatRat { ... }
  9. my class Pair { ... }
  10. my class Promise { ... }
  11. my class X::OutOfRange { ... }
  12. my class X::Dynamic::NotFound { ... }
  13. my class X::SecurityPolicy::Eval { ... }
  14. my role QuantHash { ... }
  15. my role Setty { ... }
  16. my class Set { ... }
  17. my class SetHash { ... }
  18. my role Baggy { ... }
  19. my class Bag { ... }
  20. my class BagHash { ... }
  21. my role Mixy { ... }
  22. my class Mix { ... }
  23. my class MixHash { ... }
  24. my class Lock is repr('ReentrantMutex') { ... }
  25. sub DYNAMIC(\name) is raw {
  26. nqp::ifnull(
  27. nqp::getlexdyn(nqp::unbox_s(name)),
  28. nqp::stmts(
  29. nqp::unless(
  30. nqp::isnull(my $prom := nqp::getlexdyn('$*PROMISE')),
  31. (my Mu $x := nqp::getlexreldyn(
  32. nqp::getattr($prom,Promise,'$!dynamic_context'),nqp::unbox_s(name))
  33. )
  34. ),
  35. nqp::if(
  36. nqp::isnull($x),
  37. nqp::stmts(
  38. (my str $pkgname = nqp::replace(nqp::unbox_s(name),1,1,'')),
  39. ($x := nqp::ifnull(nqp::atkey(GLOBAL.WHO,$pkgname),
  40. nqp::ifnull(nqp::atkey(PROCESS.WHO,$pkgname),
  41. Rakudo::Internals.INITIALIZE-DYNAMIC(nqp::unbox_s(name))))
  42. )
  43. )
  44. ),
  45. $x
  46. )
  47. )
  48. }
  49. # Set up ClassHOW's auto-gen proto (nested scope so it won't
  50. # actually appear in the setting).
  51. {
  52. my class Dummy {
  53. our proto method AUTOGEN(::T $: |) { * }
  54. }
  55. Dummy.HOW.set_autogen_proto(&Dummy::AUTOGEN);
  56. }