hi dan, > > why does sequential machine (;:) only take array input?
> All verbs in J only take array input. i'd say that dyadic /. 'takes verb input': it takes two arrays and a 'verb'. what is the 'verb input' to this verb called? > > couldn't it take a verb > > Not without a major redefinition of it, that would break existing code. what about this redefinition - allowing y to be an atom. in the monadic case, using 0 to indicate 'verb input' getc ;: 0 where getc returns the next character. this won't break existing code > The downside is it doesn't work so well on streams, > where it has to work on small chunks and wait a lot. no program can control the rate of input. if IO is slow, there's no pressure on J to be fast -- just expressive > Maybe that'll change if J ever supports lazy evaluation. i don't think you'd have to go that far :) > For example, here's how you could cut on newlines not enclosed in quotes: [snip] > cut =. <;._2~ mask looks similar to how csv.ijs works: fixcsv=: 3 : 0 b=. y e. LF c=. ~:/\y='"' msk=. b > c > msk <@chopcsv ;._2 y ) look, i'm not expecting that my remarks are at all educated -- i've hardly written more than 10 lines of functioning code. but i enjoy participating in this brilliant community and i get a real buzz out of learning more J. dan, thanks for your input -- you've taught me much going to stop talking now, jack. ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
