Re: [perl #126688] bug detecting circular dependencies

2016-03-27 Thread Marcel Timmerman
There should be already several bug reports mentioning this. I and someone 
else have reported this. I forgot the bug numbers though, I am on a 
vacation and therefore not able to find the bug number, sorry


Marcel Timmerman


On March 27, 2016 6:47:08 PM Carl Mäsak via RT 
 wrote:


 I like to (possibly superstitiously) have a test file with 
just use-ok in it to catch any weird  dependency issues
 RabidGravy: all I can say is, I've never used `use-ok`, not even in 
a separate file, and I don't feel that *not* getting the `use` error 
separately has in any way detracted from the testing experience.
 in fact, the usual reason I get `use` errors in the first place is 
because I forgot to `export PERL6LIB=lib` :)
 and that's easily fixed, no matter whether I have a separate test 
file with `use-ok` or not
 I think, for me, it goes back to testing very large programs 
using moose where it was easy to miss circular dependencies at a distance 
(e.g. where A uses B uses C uses D uses A) and things would stop loading 
under certain circumstances
 RabidGravy: I was going to say that "we don't allow that kind of 
circular dependencies to happen in Perl 6"
 RabidGravy: ...but then I tried it, and it puts Rakudo in an 
infinite loop :(

 just A.pm containing `use B;` and vice versa triggers it
* masak submits rakudobug
 if nothing else, it's a crappy default
 masak: there's a rakudobug open already
 oh, ok
* masak stands down
 if I find it, I can add this discussion
 ah, https://rt.perl.org/Ticket/Display.html?id=126688





Re: [perl #126688] bug detecting circular dependencies

2015-12-31 Thread mt1957

On 12/31/2015 06:58 AM, Dave Rolsky via RT wrote:

I can confirm that this is still happening as of today's rakudo. It seems like 
an important bug to fix, but maybe more importantly, how are we supposed to 
handle circular deps? Consider a pair of classes, Tree and Node, which both 
need to refer to each other.

Tree.pm6


unit class Tree;

use Node;

has Node $top;



Node.pm6


unit class Node;

use Tree;

has Tree $tree;


Given that I have to use a module in order to refer to its type, this seems 
like a problem that will occur _way_ more often in Perl 6 than in Perl 5.


Often you  can cope by not typing them in both modules . Then e.g. the 
node create method in the Tree module creates the Node object which 
receives the Tree object via the BUILD method. The Node module then does 
not have to import the tree module because all information is included 
in the Tree object just received. So the 'use Tree;' in Node.pm is not 
needed.






[perl #126688] bug detecting circular dependencies

2015-11-20 Thread via RT
# New Ticket Created by  mt1957 
# Please include the string:  [perl #126688]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=126688 >


Circular dependencies on modules are not detected anymore.

Golfed code;

File 1

   use v6;
   use Circ1;

File 2 (Circ1.pm6)

   use v6;
   use Circ2;

File 3 (Circ2.pm6)

   use v6;
   use Circ1;

This will bring the computer to its knees!

When installing the new version it seems that the bug is there for a 
month or longer: ...
Perl6 version 2015.10-206-gca7ed86 built on MoarVM version 
2015.10-56-g9fd3005
Perl6 version 2015.11-5-g08a804c built on MoarVM version 2015.11

Greetings,
Marcel Timmerman