Brian...good question! Firstly in the excitement I had not even noticed that at all. Secondly, I think it is legitimate because as I understand what I have read, using =. is local to the executing script or verb, so defining 'rows' inside a verb called rows is safe, there is a namespace for code and data I guess.
Or I've been damned fortunate thus far! :D On Fri, 11 Dec 2020 at 13:20, Brian Schott <[email protected]> wrote: > I likely am not answering your question, but I have a question about your > verbs row and rows. > In both cases you redefine a local noun with the same name as the verb. > How does that work? > > While I'm here, I want to comment that I have a hard time with your posts > because they seem to be incomplete so I cannot understand them. For example > I cannot see input nouns (data) for your verbs and cannot see sample > applications of your verbs. > > > On Fri, Dec 11, 2020 at 8:04 AM emacstheviking <[email protected]> wrote: > > > OK, I have spent some time on my postgres wrapper, using Haukes comment I > > now have this: > > > > NB. Simple crude SELECT operation > > pgsel=: 3 : 0 > > conn=: pqconnectdb<'dbname=usda' > > res=: pqexec conn;'select * from fd_group order by fddrp_desc limit 3' > > ncols=: pqnfields res > > nrows=: pqntuples res > > ) > > NB. From Hauke on the mailing list > > NB. pqfname@(res&;)"0 i. ncols > > columns =: 3 : 'dtb each<"1 psz@pqfname@(y&;)"0 i.ncols' > > > > row =: 3 : 0 > > 'res row'=.y > > psz @ pqgetvalue @ (res;row & ;) "0 i. pqnfields res > > ) > > > > rowb =: 3 : 'psz @ pqgetvalue @ (y & ;) "0 i. pqnfields y' > > > > rows=: 3 : 0 > > rows=. dtb each <"1 row @ (y & ;)"0 i. pqntuples y > > (columns y),rows > > ) > > > > -- > (B=) <-----my sig > Brian Schott > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
