I have a noun called paths, whose value changes at various points, and a verb g
that uses paths. The problem is, it only works for the initial value of paths.
paths =: \:~&.> (;~ 0$0) , <\ 2+i.7
paths
┌┬┬─┬───┬─────┬───────┬─────────┬───────────┬─────────────┐
│││2│3 2│4 3 2│5 4 3 2│6 5 4 3 2│7 6 5 4 3 2│8 7 6 5 4 3 2│
└┴┴─┴───┴─────┴───────┴─────────┴───────────┴─────────────┘
g =. >@{&paths
g
>@{&((0$0);(0$0);(,2);3 2;4 3 2;5 4 3 2;6 5 4 3 2;7 6 5 4 3 2;8 7 6 5 4 3 2)
So now when paths changes, g becomes useless.
My question is how can I get g to always check the value of paths when it is
executed? And more generally, how can the name of a noun rather than the value
of the noun be used in a verb?
Many thanks.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm