row as text-proc - Printable Version +- Curl Global Community (https://communities.curl.com) +-- Forum: Blogs (https://communities.curl.com/forumdisplay.php?fid=17) +--- Forum: Tech blog (https://communities.curl.com/forumdisplay.php?fid=18) +---- Forum: Robert blog (https://communities.curl.com/forumdisplay.php?fid=20) +---- Thread: row as text-proc (/showthread.php?tid=595) |
row as text-proc - RobertShiplett - 08-14-2012 While working on the Japanese-English dictionary interface at Jisho, I hit a puzzling bug whenI was told that I was assigning a text proc to a var, or assigning a value to a text proc ( compiler directive was stringent? .) The answer? The identifier row is known globally as a text-proc name and my own local variable declared with the name 'row' for my current or selected data grid row number had slipped out of position within some upper and outer braces but with the variable referenced outside those braces. That variable name quickly became 'ke-grid-row-num' ! I suspect that if you try {def row = you may hit the same compiler error, but {let row:int = had been fine as a local declaration in a procedure and set previous-row = row had also been fine ... If you find an oddity like this using set row = 1, you may recall that text-proc. Since the row text-proc is used for declarative tables and since that code already has a text-format named header-row, we might have done better using table-row, but row is already an accessor ... Regardless, I did a refactoring pass improving all of my var names and it has made the code easier to read which will help in the major refactoring which is yet to occur for transitioning the dictionary to a double-character kanji-only version to complement the Tuttle flashcard sets. The current Kanjidic2 and Edict2 dictionary interface is ready for beta test at the URL above. Suggestions welcome, but BUG reports VERY welcome ! BETA-TESTERS Needed !!! |