Marshall, I could not agree more with you.  Actually, I can, so to speak ;)

Why shall we stop there?  Why not to go all the way instead?    Jx shows
that the sky does not fall; it is compatible with all the libraries as far
as I know.  The only potential issues might occur when error handling code
might to match the Jx extensions behavior.

I know, I know, it is unlikely that higher-order functions would be
officially adopted in my life time, to say the  least.

Either way, I have had this opinion about gerunds since the first time you
mentioned, years ago, that boxing words seemed to be the natural way but I
am glad to hear that also it would improve performance.  I am certainly
willing to try it in Jx (of course, personally I know next to nothing about
C).

Currently in Jx one needs sometimes some extra steps to work with boxed
words,

   ( an=. ".. inv )
"..^:_1
   ( adv=. _1?:0  )
(_1?:0)



                     [: +/ (\an) (an adv") _1 ]: NB. Boxed words
┌──┬─┬─┬──┐
│+/│\│"│_1│
└──┴─┴─┴──┘
         (an f.&.>   [: +/ (\an) (an adv") _1 ]:)
┌────────┬───────┬───────┬────────┐
│┌──────┐│┌─────┐│┌─────┐│┌──────┐│
││┌─┬──┐│││┌─┬─┐│││┌─┬─┐│││┌─┬──┐││
│││0│+/│││││0│\│││││0│"│││││0│_1│││
││└─┴──┘│││└─┴─┘│││└─┴─┘│││└─┴──┘││
│└──────┘│└─────┘│└─────┘│└──────┘│
└────────┴───────┴───────┴────────┘
   ("..@:(an f.&.>)  [: +/ (\an) (an adv") _1 ]:)
+/\"_1
   ("..@:(an f.&.>)  [: +/ (\an) (an adv") _1 ]:)  i.2 3 4
 0  1  2  3
 4  6  8 10
12 15 18 21

12 13 14 15
28 30 32 34
48 51 54 57

Sometimes one does not,

       [:v0 v1 v2 v3 v4]:
┌──┬──┬──┬──┬──┐
│v0│v1│v2│v3│v4│
└──┴──┴──┴──┴──┘
   ".. [:v0 v1 v2 v3 v4]:
v0 v1 v2 v3 v4








On Thu, Aug 3, 2017 at 3:57 AM, Marshall Lochbaum <[email protected]>
wrote:

> Can I just point out that it's not too late to add some (documented) way
> to box verbs/adverbs/conjunctions? These could be treated as gerunds by
> everything that currently uses gerunds, and the interpreter can just
> throw an error if anything attempts to actually unbox them. They are
> much harder to confuse than the current gerunds, and will have far
> better performance.
>
> This sounds like a radical divergence from the way J works now, but I
> don't think it is in practice. Programmers would use some new
> conjunction to replace (`), and provided they don't inspect the
> structure of gerunds nothing else changes. I suppose there would need to
> be a way to check what class of object a box contains, because unboxing
> to check the type is not allowed. Gerunds would remain useful for
> programmers who want to inspect functions or build them from scratch,
> but would otherwise become obselete.
>
> Marshall
>
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to