Thank you everyone for the comments and encouragement. I think Bo's (?]) and accompanying code was an interesting illustration of a nice use of the hook. I'm not sure why to prefer doubling an entire array as opposed to dividing a single scalar? I think that inlining getx and gety is anti-style ;-). See also all the argument unwrapping that happens in the new revise. Too bad there is no way to prevent this.
I take it that picking # over $ is a purely stylistic preference. I appreciate all the comments regarding coppula and NB.*, both sound like a good idea. The historical comments regarding a hook conjunction exactly mirror my frustrations. Thank you Raul also for arcsX2, that is a thing of beauty =). New and improved code at http://pastebin.com/fzs0GAev with an expanded intro to "CSPs". Cheers, Mike On Thu, Nov 1, 2012 at 10:01 PM, Michal D. <[email protected]>wrote: > Hi All, > > I've managed to write my first not-completely-trivial program in J. It > implements an arc consistency algorithm ( > http://en.wikipedia.org/wiki/Local_consistency#Arc_consistency). I would > appreciate any comments regarding style, what I'm doing wrong in J or how > to improve the code. I also have a couple of questions of my own: > > 1) how do I avoid @ especially once we remove explicit arguments? > 2) how do I avoid constant boxing/unboxing due to fill (see arcsX)? > 3) Is a boxed value always a pointer? One could imagine implementing > 'ragged' arrays without pointers. > 4) Is there a good way to have named variables (ie. avoid getx, gety)? > 5) Why is a hook the default and not composition? > > Code at: http://pastebin.com/k4XuKfFi > > Cheers! > > Mike ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
