Seth, Thank you for following up! Learning something new about Netlogo and Scala everyday!
You are correct - I am only looking at the first level of the tree. I had assumed I only needed to go one level to capture all the procedures that called a set of procedures within its code block, and that all procedures would be included in the workspace.procedures map (and interested in user-defined procedures mainly). For your test case (I made a slight mod to make an edge from a procedure that didn't make any calls to a "Nothing" node), I get: FOO -> Nothing BAR -> Nothing BAZ -> FOO so clearly missed the call to Bar. BTW, what is __ignore? I don't see it in the Netlogo dictionary. Also, thanks for the nitpick - always good to clean up code. steve On Wednesday, June 17, 2020 at 2:00:46 PM UTC-4, Seth Tisue wrote: > > This looks it will produce correct output in many cases, but I'm not > convinced it's correct in general. > > Does it work on a case like this, and on even more deeply nested cases? > > to-report foo [x] report x end > to-report bar [x] report x end > to baz __ignore foo bar 0 end > > I'm looking at your logic and it isn't clear to me that all possible > nestings (including recursive nestings) of _call and _callreport are > handled properly, hence the test case. I don't see anywhere in your code > that recursively processes entire argument trees, and not just the first > level of the tree. > > Also a nitpick that won't usually affect correctness: you shouldn't need > to resort to looking for "_call" and "_callreport' as strings — _call and > _callreport are classes, you should be able to detect instances of them via > pattern matching (or `isInstanceOf`). > > Seth > -- You received this message because you are subscribed to the Google Groups "netlogo-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to netlogo-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/netlogo-devel/7bb92c80-6dd6-4255-98ee-300a25b7b198o%40googlegroups.com.