Jon ,by the way you can call me Pepe (Jose's nickname), the problem is that
I copied the execution of a script as I usually do to show it working.
However trying to execute the display can cause all sort of problems.  Try
the following clean version, with a minor aesthetic change, of the script
(I hope the EOLs do not get lost in transit).  It should run (famous last
words?).


NB. Collected definitions...

o=. @:
(x=. o[) (y=. o]) (e=. &.>)

an=. <@:((,'0') ,&< ])

Cloak=. ((5!:1)@:<'Cloak')Cloak=. (0:`)(,^:)

'at amper evoke'=. Cloak o < e o ;: '@: & `:'

train=. evoke&6 f.
box=. < o train "0

NB. First...

( G=. (*:`%: ,. +:`^) )
( L=. 1 2 )

process=. train o ([ ; an y)("0) f.

G process 4
G process L

NB. Second...

plus=. train o ([ , (<'+') , ])

times=. >@:((box <'*')"_)   NB. * boxed
ata=. (] amper times) at [  NB. amper times at

( vrb=. > o (box x (< o plus/ .(ata e)) ])f. )

( G=.  *:`+:`^ )
( L=. 3 4 5    )

G vrb L
G vrb L 1 2 3

The last time I checked debug, a long time ago, was not very tacit
friendly.  I am a big fan of dissect but it expects (correctly) verbs to
take nouns and produce nouns and it would  (rightfully) refuse to dissect
wicked verbs for that reason.

Gerunds and atomic representations are indeed tricky but there is another
method for dealing with them that you might find less painful.  I will try
to outline it after work if I have a chance.





On Mon, Apr 20, 2015 at 12:57 AM, Jon Hough <[email protected]> wrote:

> Thanks Jose,
> I am trying to run your code but am getting a syntax error with vrb:
>
> |syntax error: scriptd
>
> |   >@:(<@:(,^:(0:``:)&6)"0@:[<@:(,^:(       0:``:)&6@:([,(<'+'),]))/
> .(((]
>
>
> I was hoping to debug or dissect it to see what it does, but since I can't
> dissect it I can't figure out what the error is.
> As for tacit meta-programming, I think this is outside the bounds of my J
> ability, but am researching it.
>
>
> By the way, my whole motivation for all this is to play around with uses
> of the d. conjunction, and find the function solution to some problems (ODE
> problems etc.). (So, for example, I can list different derivatives of a
> single function/verb, and play around with them).
>
>
> I didn't realize that playing around inside gerunds was this tricky. It is
> a good learning experience though.
>
>
> Regards,
> Jon
>
>
>
> > Date: Sun, 19 Apr 2015 15:58:41 -0400
> > From: [email protected]
> > To: [email protected]
> > Subject: Re: [Jprogramming] Evaluating a Gerund Array
> >
> > (Trying again; fingers crossed)
> >
> > Tacit meta-programming is the underground playground.
> >
> > First, regarding your original post, the verb process that I posted
> > recently (see,
> > http://www.jsoftware.com/pipermail/programming/2015-April/041539.html)
> > almost produces what you want (the orthodox version or otherwise):
> >
> >
> >    process=. < o train o ([ ; (an o >) y)("0) f.
> >
> >    ( G=. (*:`%: ,. +:`^) )
> > ┌──┬──┐
> > │*:│+:│
> > ├──┼──┤
> > │%:│^ │
> > └──┴──┘
> >    ( L=. 1 2 )
> > 1 2
> >
> >    G process <4
> > ┌──┬───────┐
> > │16│8      │
> > ├──┼───────┤
> > │2 │54.5982│
> > └──┴───────┘
> >    G process 1;2
> > ┌───────┬───────┐
> > │1      │2      │
> > ├───────┼───────┤
> > │1.41421│7.38906│
> > └───────┴───────┘
> >
> > Actually, a simplified version of process produces what you want (I
> think):
> >
> >    process=. train o ([ ; an y)("0) f.
> >
> >    G process 4
> > 16       8
> >  2 54.5982
> >    G process L
> >       1       2
> > 1.41421 7.38906
> >
> > Second, regarding,
> > "
> > For example, if G =:  *:`+:`^  and list =. 3 4 5
> > I want an adverb or conjunction that returns a verb of the form
> (3&*@:*:) +
> > (4&*@:+:) + (5&*@:^)
> > "
> >
> > The request is similar to the question posed in the post
> > http://www.jsoftware.com/pipermail/programming/2008-January/009553.html
> and
> > an underground answer is also similar to the one posted in
> > http://www.jsoftware.com/pipermail/programming/2014-November/040108.html
> :
> >
> > The powers of verbs verb ( pv=. (box x (at&>~ / .(power e)) ])f. ) can be
> > modified as follows:
> >
> >    plus=. train o ([ , (<'+') , ])
> >
> >    STAR=. >@:((box <'*')"_)   NB. * boxed
> >    asa=. (] amper STAR) at [  NB. amper star at
> >
> >    ( vrb=. > o (box x (< o plus/ .(asa e)) ])f. )
> > >@:(<@:(,^:(0:``:)&6)"0@:[ <@:(,^:(0:``:)&6@:([ , (<'+') , ]))/ .(((]
> > ,^:(0:`&) >@:((<*)"_)) ,^:(0:`@:) [)&.>) ])
> >
> >
> >    G vrb L
> > 3&*@:*: + 4&*@:+: + 5&*@:^
> >    G vrb L 1 2 3
> > 24.5914 64.9453 151.428
> >
> > Note that vrb is a verb; it is an underground solution after all.  It is
> > not difficult to cloak it as an adverb but sadly, because the form (c a)
> > was removed a long time ago, it is not possible to cloak it as a
> > conjunction using a current official interpreter.  In extended J (see,
> > http://www.jsoftware.com/pipermail/programming/2013-March/031835.html) ,
> > particularly in a version that is still cooking, is not only possible but
> > there is a lot more support to make underground tacit meta-programming
> even
> > easier.
> >
> > I am appalled that you overlooked the significance of my posts...  I am,
> of
> > course, kidding (I could not resist)  ;)
> >
> > P.S.
> >
> >    NB. Collected definitions...
> >
> >    o=. @:
> >    (x=. o[) (y=. o]) (e=. &.>)
> > ((o[)(o]))(&.>)
> >
> >    an=. <@:((,'0') ,&< ])
> >
> >    Cloak=. ((5!:1)@:<'Cloak')Cloak=. (0:`)(,^:)
> >
> >    'at amper evoke'=. Cloak o < e o ;: '@: & `:'
> >
> >    train=. evoke&6 f.
> >    box=. < o train "0
> >
> >    NB. First...
> >
> >    ( G=. (*:`%: ,. +:`^) )
> > ┌──┬──┐
> > │*:│+:│
> > ├──┼──┤
> > │%:│^ │
> > └──┴──┘
> >    ( L=. 1 2 )
> > 1 2
> >
> >    process=. train o ([ ; an y)("0) f.
> >
> >    G process 4
> > 16       8
> >  2 54.5982
> >    G process L
> >       1       2
> > 1.41421 7.38906
> >
> >    NB. Second...
> >
> >    plus=. train o ([ , (<'+') , ])
> >
> >    STAR=. >@:((box <'*')"_)   NB. * boxed
> >    asa=. (] amper STAR) at [  NB. amper star at
> >
> >    ( vrb=. > o (box x (< o plus/ .(asa e)) ])f. )
> > >@:(<@:(,^:(0:``:)&6)"0@:[ <@:(,^:(0:``:)&6@:([ , (<'+') , ]))/ .(((]
> > ,^:(0:`&) >@:((<*)"_)) ,^:(0:`@:) [)&.>) ])
> >
> >    ( G=.  *:`+:`^ )
> > ┌──┬──┬─┐
> > │*:│+:│^│
> > └──┴──┴─┘
> >    ( L=. 3 4 5    )
> > 3 4 5
> >
> >    G vrb L
> > 3&*@:*: + 4&*@:+: + 5&*@:^
> >    G vrb L 1 2 3
> > 24.5914 64.9453 151.428
> >
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to