Re: [Jprogramming] Gerund composed application

2017-09-26 Thread Jose Mario Quintana
> >>+: , ] `+/ % # C:: @ > >> > >> (+: , ])@(+/ % #) > >> > >> '+: , ] ` + / % #' gg cc '@' 1 2 3 > >> 4 2 > >> > >> > >> underlying code is pretty short though, (except for aar dependencies)

Re: [Jprogramming] Gerund composed application

2017-09-25 Thread Raul Miller
x27; gg cc '@' 1 2 3 >> 4 2 >> >> >> underlying code is pretty short though, (except for aar dependencies) >> >> strinsert =: 1 : ' [ , u , ]' >> eval =: 1 : ' a: 1 : m' >> isNoun =: (0 = 4!:0 ::0:)@:< >> aar =: 1 : 'if. isNoun ''u'' do. q

Re: [Jprogramming] Gerund composed application

2017-09-25 Thread Jose Mario Quintana
encies) > > strinsert =: 1 : ' [ , u , ]' > eval =: 1 : ' a: 1 : m' > isNoun =: (0 = 4!:0 ::0:)@:< > aar =: 1 : 'if. isNoun ''u'' do. q =. m eval else. q =. u end. 5!:1 < > ''q'' ' > > cc =: 2 : &#

Re: [Jprogramming] Gerund composed application

2017-09-25 Thread 'Pascal Jasmin' via Programming
_____ From: Raul Miller To: Programming forum Sent: Sunday, September 24, 2017 10:56 PM Subject: Re: [Jprogramming] Gerund composed application Ah, sorry, I had not read your original post close enough. That's a bad habit, and I need to do better on reading other people's c

Re: [Jprogramming] Gerund composed application

2017-09-24 Thread Jose Mario Quintana
I am surprised to hear that the second solution produces a syntax error in J604 even taking into account that J604 is quite old. I am pretty sure it should work in J701 and definitely works in, JVERSION Engine: j805/j64/windows Release: commercial/2016-12-11T08:02:16 Library: 8.05.10 Qt IDE: 1

Re: [Jprogramming] Gerund composed application

2017-09-24 Thread Raul Miller
Ah, sorry, I had not read your original post close enough. That's a bad habit, and I need to do better on reading other people's concepts. That said, I can offer some variants on Jose's approach: at=:4 :0 x`:6@:(y`:6)`'' ) Example use: at/(]`{.`{:`{:) Or, equivalently: at=: (<'@:') ,@<@,

Re: [Jprogramming] Gerund composed application

2017-09-24 Thread Louis de Forcrand
rob=: {: ,~ ({.[:`'') ,@,. }: g=: %:`*:`+: g +--+--+--+ |%:|*:|+:| +--+--+--+ rob g +--+--+--+--+--+ |[:|%:|[:|*:|+:| +--+--+--+--+--+ (rob g)`:6]5 10 "rob" transforms your gerund into a suitable train. You can then apply it with `:6. Cheers, Louis > On 24 Sep 2017, at 20:35, Rob

Re: [Jprogramming] Gerund composed application

2017-09-24 Thread Rob Moore
Thanks for replying Raul, your solutions weren't what I was looking for, but I understand the confusion from my first explanation. Jose your first solution worked perfectly, thanks very much! The other two solutions you gave caused syntax errors for me, must be different versions, I'm on 604. Wha

Re: [Jprogramming] Gerund composed application

2017-09-24 Thread Rob Moore
Hi, sorry let me try to clarify and give my own use case. I'm looking for a function which takes a gerund on the left and applies the gerund's verbs one by one monadically from right to left to the right argument, (with no rank modifications to the verbs). My use case is that I'm implementing red

Re: [Jprogramming] Gerund composed application

2017-09-24 Thread Jose Mario Quintana
an=. <@:((,'0') (,&:<) ])NB. Atomizing words (monadic verb) f=. '(x , an y)`:6' (dyad :) NB. Explicit compliant version (*:`+:) f 4 64 train=. (<'`:')(0:`)(,^:)&6 f=. train@:([ , an@:]) f. NB. Non-compliant fixed tacit version (*:`+:) f 4 64 f=. "..@:([ , "..i

Re: [Jprogramming] Gerund composed application

2017-09-24 Thread Raul Miller
You did not give an example of what you want to see, and your description allows for at least two different interpretations: f1=: 4 :'x`:6 y'"_1 f2=: 4 :'((#y)$x) f1 y' They both give the same result when x and y have the same number of items. What are you trying to do? Thanks, -- Raul On

[Jprogramming] Gerund composed application

2017-09-24 Thread Rob Moore
Hi guys, I am wondering if there already exists a way of doing something that I want, which is an elementary enough operation that I was quite surprised to not have found it in jvoc/evoke gerund. If I have some gerund say *:`+: I am looking for some function which will apply the gerund's constit