Re: [Jprogramming] key

2013-04-15 Thread Raul Miller
I have often wished for that. -- Raul On Mon, Apr 15, 2013 at 8:43 PM, Roger Hui wrote: > I have a question concerning your use of *key*. Do you find yourself > wishing that in x f/.y, the f would be invoked with a left argument which > is key value corresponding to the items in the right argu

Re: [Jprogramming] Table of Verbs

2013-04-15 Thread Raul Miller
On Mon, Apr 15, 2013 at 8:28 PM, Jose Mario Quintana wrote: > So far no solution is transforming T into U and perhaps emulating U is what > was meant, as in > Raul's solution T(4 :'http://www.jsoftware.com/forums.htm

Re: [Jprogramming] key

2013-04-15 Thread Henry Rich
Yes, very much. I am continually writing x (~.@[ ... f/.) y And what does it cost? f@]/. would get the current behavior. Henry Rich On 4/15/2013 8:43 PM, Roger Hui wrote: I have a question concerning your use of *key*. Do you find yourself wishing that in x f/.y, the f would be invoked wit

Re: [Jprogramming] key

2013-04-15 Thread Dan Bron
Yes. Please excuse typos; composed on a handheld device. On Apr 15, 2013, at 6:43 PM, Roger Hui wrote: > I have a question concerning your use of *key*. Do you find yourself > wishing that in x f/.y, the f would be invoked with a left argument which > is key value corresponding to the items

[Jprogramming] key

2013-04-15 Thread Roger Hui
I have a question concerning your use of *key*. Do you find yourself wishing that in x f/.y, the f would be invoked with a left argument which is key value corresponding to the items in the right argument? This does not mean that the J definition or implementation will be changed, but to find out

Re: [Jprogramming] Table of Verbs

2013-04-15 Thread Jose Mario Quintana
> On Sun, Apr 14, 2013 at 10:41 AM, km wrote: >> It would be nice if there were a simple way to transform your T into U : >> >> U =: 2 2 $ +/ ; |: ; |. ; -/ . * So far no solution is transforming T into U and perhaps emulating U is what was meant, as in Raul's solution T(4 :'http://www.jsoftw

Re: [Jprogramming] Table of Verbs

2013-04-15 Thread Linda Alvord
Thanks. Linda -Original Message- From: programming-boun...@forums.jsoftware.com [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Raul Miller Sent: Monday, April 15, 2013 11:03 AM To: Programming forum Subject: Re: [Jprogramming] Table of Verbs A=:>:i.2 2 F=: 2 2$ '+/

[Jprogramming] Calling .NET from vanilla J

2013-04-15 Thread Greg Borota
http://pythonnet.sourceforge.net/ http://pythonnet.sourceforge.net/readme.html These guys call .NET from the C based python interpreter. Without implementing Python on the .NET platform like IronPython does it. So maybe that same approach would work with J too. Just throwing this out there, maybe

Re: [Jprogramming] Table of Verbs

2013-04-15 Thread Raul Miller
A=:>:i.2 2 F=: 2 2$ '+/';'|:';'|.';'-/ .*' ([:$"."1)(>"0 F)(,"1)2 2 1$'A' 2 2 2 2 ([:$".)"1(>"0 F)(,"1)2 2 1$'A' 2 0 2 2 2 2 0 0 So it's about the relevance of those parenthesis. 9!:3]6 $@"."1 ($@".)"1 ([:$"."1) [: $ ("."1) ([:$".)"1 ([: $ ".)"1 You need $ to be modifi

Re: [Jprogramming] Table of Verbs

2013-04-15 Thread Tracy Harms
An example where a table of verbs is used in a J program is the poker-scoring program I posted to the wiki. In that instance look at the definition and use of ScoringTable http://www.jsoftware.com/jwiki/TracyHarms/PokerHandsScoring --

Re: [Jprogramming] Table of Verbs

2013-04-15 Thread Linda Alvord
Maybe this is a clearer explanation of my question. A=:>:i.2 2 f=: 2 2$ '+/';'|:';'|.';'-/ .*' "."1 (>"0 f)(,"1)2 2 1$'A' 4 6 0 0 1 3 2 4 3 4 1 2 _2 0 0 0 <"2 "."1 (>"0 f)(,"1)2 2 1$'A' ┌───┬┐ │4 6│1 3 │ │0 0│2 4 │ ├───┼┤ │3 4│_2 0│ │1 2│ 0 0│ └───┴┘ ($@"

Re: [Jprogramming] Table of Verbs

2013-04-15 Thread Raul Miller
Does this help? require 'general/misc/trace' trace 'U=: T (4 :'' wrote: > Kip, Raul's works with a space after 4 > >T =: 2 2 $ +/`|:`|.`(-/ .*) >U=: T (4:'U i.2 2 > 4 >U=: T (4 :'U i.2 2 > ┌───┬───┐ > │2 4│0 2│ > │ │1 3│ > ├───┼───┤ > │2 3│_2 │ > │0 1│ │ > └───┴───┘ >

Re: [Jprogramming] Table of Verbs

2013-04-15 Thread Linda Alvord
Raul, I like your use of capitals for data and small letters for functrions, so... T =: 2 2 $ +/`|:`|.`(-/ .*) T ┌───┬───┐ │┌─┬───┐│|: │ ││/│┌─┐││ │ ││ ││+│││ │ ││ │└─┘││ │ │└─┴───┘│ │ ├───┼─

Re: [Jprogramming] Table of Verbs

2013-04-15 Thread Linda Alvord
Kip, Raul's works with a space after 4 T =: 2 2 $ +/`|:`|.`(-/ .*) U=: T (4:'mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Raul Miller Sent: Monday, April 15, 2013 8:23 AM To: Programming forum Subject: Re: [Jprogramming] Table of Verbs U=: T (4 :' wrote: > Your use of `:

Re: [Jprogramming] Table of Verbs

2013-04-15 Thread Raul Miller
U=: T (4 :' wrote: > Your use of `: is very neat, thank you, but the desired results are those of > U below. --Kip > > T =: 2 2 $ +/`|:`|.`(-/ .*) > <"2 (T `: 0) i. 2 2 > +---++ > |2 4|0 2 | > |0 0|1 3 | > +---++ > |2 3|_2 0| > |0 1| 0 0| > +---++ > <"2 (T `: 0)

Re: [Jprogramming] Table of Verbs

2013-04-15 Thread km
Your use of `: is very neat, thank you, but the desired results are those of U below. --Kip T =: 2 2 $ +/`|:`|.`(-/ .*) <"2 (T `: 0) i. 2 2 +---++ |2 4|0 2 | |0 0|1 3 | +---++ |2 3|_2 0| |0 1| 0 0| +---++ <"2 (T `: 0) i. 3 3 +---+-+ |9 12 15|0 3 6| |0

Re: [Jprogramming] Table of Verbs

2013-04-15 Thread Linda Alvord
(>"0 f)(,"1)2 2 1$'A' +/ A |: A |. A -/ .*A (>"0 f)(,"1)2 2 1$'A' +/ A |: A |. A -/ .*A If u@v y ↔ u v y shouldn't these two agree? ($@"."1)(>"0 f)(,"1)2 2 1$'A' 2 0 2 2 2 2 0 0 n ($"."1)(>"0 f)(,"1)2 2 1$'A' |domain error | ($"."1)(>"0 f)(,"1)

Re: [Jprogramming] Table of Verbs

2013-04-15 Thread Jan-Pieter Jacobs
I think the answer can be even more compact using the Evoke Gerund conjunction: T =: 2 2 $ +/`|:`|.`(-/ .*) <"2 (T `: 0) i. 2 2 <"2 (T `: 0) i. 3 3 Jan-Pieter 2013/4/15 Linda Alvord > > A=:i.2 2 ><"2 "."1 (>"0 f)(,"1)2 2 1$'A' > T┐ > │2 4│0 2 │ > │0 0│1 3 │ > +---++ > │2 3│

Re: [Jprogramming] Table of Verbs

2013-04-15 Thread Linda Alvord
A=:i.2 2 <"2 "."1 (>"0 f)(,"1)2 2 1$'A' T┐ │2 4│0 2 │ │0 0│1 3 │ +---++ │2 3│_2 0│ │0 1│ 0 0│ L---+- <"2 "."1 (>"0 f)(,"1)2 2 1$'B' T-┐ │9 12 15│0 3 6│ │0 0 0│1 4 7│ │0 0 0│2 5 8│ +---+-+ │6 7 8 │0 0 0│ │3 4 5 │0 0 0│ │0 1 2 │0 0 0│ L---+---