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
riffraff so, _how_ is it possible? 🙂 15:18
I couldn't find it in the docs
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 :)
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
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;`