01:19 TempIRCLogger left, lizmat left 01:21 parv left 05:36 parv joined 08:16 parv left, parv joined 09:47 lizmat_ left 09:48 lizmat joined 10:58 parv left 11:48 riffraff joined 12:30 riffraff left, riffraff joined 12:35 riffraff left 12:39 riffraff joined 13:12 riffraff left 14:17 riffraff joined
riffraff hey everyone, I am playing with Grammars, and I have a question: is it possible to cause the parsing process to fail from within an action method? Eg. something like 14:20
method myrule($/) { fail if something }
Anton Antonov Yes, it is possible. 14:56
15:10 riffraff left, riffraff joined 15:11 riffraff left 15:12 riffraff joined
riffraff so, _how_ is it possible? 🙂 15:18
I couldn't find it in the docs
15:19 riffraff left
Anton Antonov @riffraff#6339 Sorry, my confirmation was not helpful, it seems... 15:30
@riffraff#6339 More or less in the way wrote it. Say, something like `method myrule($/) { die "failed" unless $<smthng>;}` 15:32
Xueji Hello. How can I solve cyclic dependency between classes? Let's say I have class A that has B as attribute. And in B I want to call a method that will instantiate A for me. 16:47
```
my class B {
has A $.a;
}
my class A {
method get-B() {
return B.new(self);
}
}
```
Something like this.
Hello. How can I solve cyclic dependency between classes? Let's say I have class A that has B as attribute. And in B I want to call a method that will instantiate A for me.
```
my class B {
has A $.a;
# some code ...
}
my class A {
method get-B() {
return B.new(self);
}
}
```
gfldex m:``` 18:30
class A { ... }
my class B {
has A $.a;
# some code ...
}
my class A {
method get-B() { 18:31
return B.new(self);
}
}
```
@Xueji#0156 with a forward declaration ^^^ 18:32
Xueji Oh, thanks! I didn't realized I can do that :)
Oh, thanks! I didn't realiz I can do that :)
Oh, thanks! I didn't realize I can do that :)
19:36 parv joined
Hydrazer im trying to use a file as a module but it says``` 23:32
===SORRY!=== Error while compiling /home/runner/module-test/main.raku
Could not find Bruh in:
inst#/home/runner/.raku
inst#/nix/store/kvsflpnil32pmfsgdjaqn9d7argg974n-rakudo-2021.07/share/perl6/site
inst#/nix/store/kvsflpnil32pmfsgdjaqn9d7argg974n-rakudo-2021.07/share/perl6/vendor
inst#/nix/store/kvsflpnil32pmfsgdjaqn9d7argg974n-rakudo-2021.07/share/perl6/core
23:32 discord-raku-bot left, discord-raku-bot joined
im trying to use a file as a module but it says``` 23:32
===SORRY!=== Error while compiling /home/runner/module-test/main.raku
Could not find Bruh in:
inst#/home/runner/.raku
inst#/nix/store/kvsflpnil32pmfsgdjaqn9d7argg974n-rakudo-2021.07/share/perl6/site
inst#/nix/store/kvsflpnil32pmfsgdjaqn9d7argg974n-rakudo-2021.07/share/perl6/vendor
inst#/nix/store/kvsflpnil32pmfsgdjaqn9d7argg974n-rakudo-2021.07/share/perl6/core
ap#
nqp#
perl5#
at /home/runner/module-test/main.raku:1
```Bruh.rakumod```pl
module Bruh;
sub bruh($n) is export {
im trying to use a file as a module but it says``` 23:42
===SORRY!=== Error while compiling /home/runner/module-test/main.raku
Could not find Bruh in:
inst#/home/runner/.raku
inst#/nix/store/kvsflpnil32pmfsgdjaqn9d7argg974n-rakudo-2021.07/share/perl6/site
inst#/nix/store/kvsflpnil32pmfsgdjaqn9d7argg974n-rakudo-2021.07/share/perl6/vendor
inst#/nix/store/kvsflpnil32pmfsgdjaqn9d7argg974n-rakudo-2021.07/share/perl6/core
ap#
nqp#
perl5#
at /home/runner/module-test/main.raku:1
```Bruh.rakumod```pl
unit module Bruh;
sub bruh($n) is export {
ah i got it i need to add `use lib ".";` before the `use Bruh;`