Right, the closest I can come to my HOF example in standard J is: scan =: dyad def '(x`:6)\ y' sum =: +/ sum`'' scan 1 2 3 1 3 6
It would be more convenient to just write 'x\y' where x is a verb, but I realize this would be a significant change to parsing and semantics (even if it's a rather minor change to syntax). I will check out the parser source code, maybe I can scrape together something for people to try out. But please no one hold their breath. :) On Wed, Nov 22, 2017 at 12:05 PM, Henry Rich <[email protected]> wrote: > Single gerund: > > verb`'' > > or > > {. verb`'' > > > Henry Rich > > On 11/21/2017 6:02 PM, Daniel Lyons wrote: > >> On Nov 21, 2017, at 11:56 AM, Alex Shroyer <[email protected]> wrote: >>> >>> However, one frustration I still have is regarding explicit definitions. >>> IMO they should be replaced with something more like what the K language >>> provides, namely first-class, lexically-scoped functions: >>> >> >> This is a nice thing in Dyalog as well, and it has the same syntax there, >> except alpha for x and omega for y. My experience from other systems makes >> me feel that code in strings is icky, and it doesn’t syntax-highlight well >> either. On the other hand, I am still new—is it common to pass around >> strings bearing code? This is common in Tcl, where there are several ways >> of quoting. I don’t see an obvious way to make a gerund from a single >> verb—is that ever done, and are strings the secret to it? >> >> > > --- > This email has been checked for viruses by AVG. > http://www.avg.com > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
