# This file automatically generated by /friends/.rakubrew/versions/moar-main/tools/build/gen-cat.nqp #line 1 SETTING::src/core.d/core_prologue.rakumod use nqp; # This constant specifies the current CORE revision. It must precede class # declarations to allow correct recording of their respective language version. my constant CORE-SETTING-REV = nqp::box_i(2, Metamodel::Configuration.language_revision_type); #line 1 SETTING::src/core.d/await.rakumod my role X::Await::Died { has $.await-backtrace; multi method gist(::?CLASS:D:) { "An operation first awaited:\n" ~ ((try $!await-backtrace ~ "\n") // '') ~ "Died with the exception:\n" ~ callsame().indent(4) } } proto sub await(|) {*} multi sub await() { die "Must specify an Awaitable to await (got an empty list)"; } multi sub await(Any:U $x) { die "Must specify a defined Awaitable to await (got an undefined $x.^name())"; } multi sub await(Awaitable:D \a) { CATCH { unless nqp::istype($_, X::Await::Died) { ($_ but X::Await::Died(Backtrace.new(5))).rethrow } } $*AWAITER.await(a) } multi sub await(*@awaitables) { CATCH { unless nqp::istype($_, X::Await::Died) { ($_ but X::Await::Died(Backtrace.new(5))).rethrow } } $*AWAITER.await-all(@awaitables) } my role X::React::Died { has $.react-backtrace; multi method gist(::?CLASS:D:) { "A react block:\n" ~ ((try $!react-backtrace ~ "\n") // '') ~ "Died because of the exception:\n" ~ callsame().indent(4) } } my class Rakudo::Internals::ReactAwaitable does Awaitable { has $!handle; method new($handle) { self.CREATE!set-handle($handle) } method !set-handle($handle) { $!handle = $handle; self } method get-await-handle() { $!handle } } my class Rakudo::Internals::ReactAwaitHandle does Awaitable::Handle { has &!react-block; method not-ready(&react-block) { self.CREATE!set-react-block(&react-block) } method !set-react-block(&react-block) { &!react-block = &react-block; self } method subscribe-awaiter(&subscriber) { SUPPLY(&!react-block).tap: { warn "Useless use of emit in react" }, done => { subscriber(True, Nil) }, quit => { subscriber(False, $_) }; } } my class Rakudo::Internals::ReactOneWheneverAwaitHandle does Awaitable::Handle { has &!react-block; method not-ready(&react-block) { self.CREATE!set-react-block(&react-block) } method !set-react-block(&react-block) { &!react-block = &react-block; self } method subscribe-awaiter(&subscriber) { SUPPLY-ONE-WHENEVER(&!react-block).tap: { warn "Useless use of emit in react" }, done => { subscriber(True, Nil) }, quit => { subscriber(False, $_) }; } } sub REACT(&block --> Nil) is implementation-detail { CATCH { ($_ but X::React::Died(Backtrace.new(5))).rethrow } $*AWAITER.await(Rakudo::Internals::ReactAwaitable.new( Rakudo::Internals::ReactAwaitHandle.not-ready(&block))); } sub REACT-ONE-WHENEVER(&block --> Nil) is implementation-detail { CATCH { ($_ but X::React::Died(Backtrace.new(5))).rethrow } $*AWAITER.await(Rakudo::Internals::ReactAwaitable.new( Rakudo::Internals::ReactOneWheneverAwaitHandle.not-ready(&block))); } #line 1 SETTING::src/core.d/operators.rakumod proto sub undefine(Mu, *%) is raw is implementation-detail { Rakudo::Deprecations.DEPRECATED: 'another way: assign a Nil; for Arrays/Hashes, assign Empty or ()', Nil, '6.e', :lang-vers, :what; {*} } multi sub undefine(Mu \x) is raw { x = Nil } multi sub undefine(Array \x) is raw { x = Empty } multi sub undefine(Hash \x) is raw { x = Empty } sub infix:<<(<+)>> (|) { die "(<+) was removed in v6.d, please use (<=) operator instead or compile your code with 'use v6.c'" } sub infix:<≼>(|) { die "≼ was removed in v6.d, please use ⊆ operator instead or compile your code with 'use v6.c'" } sub infix:<<(>+)>> (|) { die "(>+) was removed in v6.d, please use (>=) operator instead or compile your code with 'use v6.c'" } sub infix:<≽>(|) { die "≽ was removed in v6.d, please use ⊇ operator instead or compile your code with 'use v6.c'" } # vim: set ft=perl6 nomodifiable :