moodymudskipper / flow

View and Browse Code Using Flow Diagrams
https://moodymudskipper.github.io/flow/
Other
395 stars 26 forks source link

nested function definitions #24

Closed moodymudskipper closed 4 years ago

moodymudskipper commented 4 years ago

This is frustrating to investigate, as a good part of the logic is in functions defined at the start.

funflow::view_flow(tools::Rd2ex)

They could be boxed, the function call and args without body would be on top in an oval shape with arrow upward (maybe see if we can find another arrow to mean "assign", else we'll use an "assign" label" next to the arrow). Then the body would be a flow diagram.

This box is probably more useful that the casewhen box

moodymudskipper commented 4 years ago

maybe there need to be a min "length" before unwrapping a function, of0 <- function(...) of1(paste0(...)) should stay as a simple call for instance (I think).

Maybe at first just unwrap multiline functons.

moodymudskipper commented 4 years ago

This example is good because we have deep nesting, as render renderDont

moodymudskipper commented 4 years ago

Nesting will be a mess, we can do much better and much simpler.

In funflow::view_flow(tools::Rd2ex) we see that we have a function definition in the 1st box.

funflow already uses a printing method (we don't View through a side effect). Thus we can use a subsetting method too, we could use [ with two arguments :

In our example we'd have :

moodymudskipper commented 4 years ago

we chose another way but the feature is there

github-actions[bot] commented 2 years ago

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.