[posting my response in-line for context] On Thu, Feb 11, 2016 at 12:55 AM, Matthew Baulch <[email protected]> wrote: > Thanks everyone. This (let's say) creative use of 0 : 0 makes sense to me > now. I wonder if it's an accidental consequence of the implementation that > allows an expression following the 0, or whether it's a deliberate design > decision. Either way, it makes sense to have it documented. Can't see it in > NuVoc or the Dictionary. Of course, I may have overlooked it.
http://www.jsoftware.com/help/dictionary/d310n.htm says 0 : n noun So the result of 0 : 0 is a noun. (Specifically, it's a list of characters.) So you should expect that anything you can do with a noun you can do with a noun produced by 0 : 0 Or, that's how I read it... Note also that you can have multiple explicit definitions on the same line. They pull their scripts from the input stream in the order that they are parsed (mostly that's right-to-left). This can be fun to play with, sometimes, but I guess it's usually better to give scripts names. > Honestly, to obtain something simple like multi-line noun definitions, ". > does seem like quite a heavy-handed tool. It does work however, so I > probably shouldn't grumble. I'm not sure why you say that. One possibility is that ". cannot produce adverb or conjunction results. (If that is the issue, you can resolve it by moving the assignment statement inside the explicit noun.) Another possibility is that you would prefer a more heavy handed approach (for example, moving an "ignore end of line" implementation inside the interpreter and then changing other aspects of the interpreter to taste.) But it's even more likely that I'm simply not following your thought process. Would you care to elucidate? Thanks, -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
