I discovered the facility/bug that allows passing an adverb or conjunction to an adverb by intuitively typing an expression of the form ( N (a0 a1) ) where N a1 produced an adverb argument taken by a1 and later I was initially surprised when I realized that ( N (a0 a1) ) and ( (N a0) a1) were different (the latter resulting in a train of adverbs). This facility, unfortunately, will not help very much for solving the problem at hand because, if I am not mistaken, the execution of ([: f g h U ) starts by trying to resolve ( h U); thus, it passes the result of ( h (strand (<'[:')) ) to (eg 1) which in turn generates a length error. In other words, the issue and its workaround identified by Ambrus would still be relevant (I fell into a similar trap some time ago). Nevertheless, I find the facility very attractive intellectually and pragmatically essentially for the same reasons that Dan pointed out. It seems to me that it is/was a natural facility (and a piece of programming code had to be patched to remove it). Roger told me that the bug/facility was being removed because it was "very dangerous." Although I am not very interested to enter into an argument I would like to mention that, as far as I am aware, it has not yet harmed me in any way; on the contrary.
________________________________ From: Dan Bron <[email protected]> To: Programming forum <[email protected]> Sent: Fri, June 18, 2010 12:17:47 PM Subject: Re: [Jprogramming] Verb pipelines Thanks Ambrus, that makes sense. I was thinking that eg1 wouldn't be applied until stc finished execution, meaning until the recursion had bottomed out, but I can see now why J tries to execute eg1 with the adverb h stc as an argument before the recursion is invoked. As for a workaround, yes: my current (unsatisfying) solution inspects & modifies stc in the manner you describe, through code generation. It works, but I was hoping for a lighter weight solution. On an related note, Pepe once identified an interesting "bug" in J: http://www.jsoftware.com/pipermail/programming/2008-February/009871.html to wit: it used to be possible to pass operators as arguments to operators. He pointed this out to Roger, who immediately closed the hole. This change may be exactly what prevents me from achieving my goal. I'm going to fire up an old J and find out (I'm almost positive that if I go back far enough to get the trains table, I could do this, but I'm interested if I could do by just leveraging Pepe's bug). More generally, the fact that I can't consume operators as arguments (except as quoted names) frequently frustrates my efforts at metaprogramming, and I think J would be a richer language if it permitted this. But if we were going to make this change (we're not), we should have the courage of our convictions, and change the Dictionary to match. Otherwise, it really is a bug. -Dan ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
