Closed tavmem closed 10 years ago
I noticed that. Is that a bug, or am I misunderstanding how scope works in kona?
Scott
On Tue, Mar 11, 2014 at 7:07 PM, Tom Szczesny notifications@github.comwrote:
Although the simplified problem instance documented as issue 239 was resolved, the BWT app still does not work properly:
bwt:{[s],//1#'|:'{x@<x}(!#a)!:\a:"\0",s} // the BWT s:{x@<x} twb:{[e]1_*s(-1+#e){[x]e,'s x}/e} // undo the BWT twb bwt "dilute dilute ok!" (;;;;;;;;;;;;;;;;"\000")
e:bwt "dilute dilute ok!" twb bwt "dilute dilute ok!" "dilute dilute ok!"
You only get a correct result by making the "bwt result" a global.
Reply to this email directly or view it on GitHubhttps://github.com/kevinlawler/kona/issues/240 .
Scope should not work like that in Kona. There is at least one bug there, and there may be several that need to be discovered and fixed before BWT works properly.
As an interim solution, this method creates an extra local variable m, but eliminates the global e. bwt:{[s],//1#'|:'{x@<x}(!#a)!\: a:"\0",s} // the BWT s:{x@<x} twb:{[e]1_*s m:(-1+#e){[x]e,'s x}/e} // undo the BWT twb bwt "dilute dilute ok!" "dilute dilute ok!"
Epilogue: it works now (no extra globals, no extra locals): bwt:{[s],//1#'|:'{x@<x}(!#a)!\: a:"\0",s} // the BWT s:{x@<x} twb:{[e]1_*s(-1+#e){[x]e,'s x}/e} // undo the BWT twb bwt "dilute dilute ok!" "dilute dilute ok!"
Although the simplified problem instance documented as issue 239 was resolved, the BWT app still does not work properly:
bwt:{[s],//1#'|:'{x@<x}(!#a)!\: a:"\0",s} // the BWT s:{x@<x} twb:{[e]1_*s(-1+#e){[x]e,'s x}/e} // undo the BWT twb bwt "dilute dilute ok!" (;;;;;;;;;;;;;;;;"\000")
twb e: bwt "dilute dilute ok!" "dilute dilute ok!"
You only get a correct result by making the "bwt result" a global.