Re: [Jprogramming] Verbs that contain nouns

2012-07-30 Thread Jose Mario Quintana
This is what I had in mind: (g =. '>@{&paths'&apply f.) NB. instead of (g=. >@{&paths)) '>@{&paths'&(128!:2) paths=. 2 ([: (|. each) (;~ 0$0) , (<\@:+ i.)) 7 g 4 4 3 2 g 3 2 $ 2 4 1 5 0 2 0 0 0 4 3 2 0 0 0 0 0 5 4 3 2 0 0 0 0 2 0 0 0 g 8 8 7 6 5 4 3 2 paths=. 3 ([: (|.

Re: [Jprogramming] Verbs that contain nouns

2012-07-30 Thread Raul Miller
On Sun, Jul 29, 2012 at 11:59 PM, Ian Shannon wrote: > There is another solution. It's often helpful, in this kind of statement, if you say what is being solved. > Make your noun into a verb as in: ... Here's one approach for making a noun into a verb: noun"_ Or, if you are concerned about

Re: [Jprogramming] Verbs that contain nouns

2012-07-29 Thread Ian Shannon
There is another solution. Make your noun into a verb as in: NB. just a few helpers, could be defined later. pathA =: [: (|. each) (;~ 0$0) , (<\@:+ i.) NB. calculation of the data pathB =: <\ i. NB. Either monadic or dyadic hook, possible pathC =: (2 pathA 7)"_

Re: [Jprogramming] Verbs that contain nouns

2012-07-23 Thread Raul Miller
On Sun, Jul 22, 2012 at 2:51 PM, David Vaughan wrote: > So there's no way to achieve it with a tacit verb? There's many ways. I'm fond of: do bind 'name' In other words, instead of paths =: \:~&.> (;~ 0$0) , <\ 2+i.7 g =. >@{&paths use g=: >@{&(do bind 'paths') or, perhaps g=:

Re: [Jprogramming] Verbs that contain nouns

2012-07-23 Thread Pepe Quintana
.com Subject: Re: [Jprogramming] Verbs that contain nouns If the code in the string is altering the content of the string, you get non-von Neuman programming, with (sometimes) very neat consequences. Powerful, yes, but equally dangerous and sometimes even hardly predictable. R.E.

Re: [Jprogramming] Verbs that contain nouns

2012-07-23 Thread R.E. Boss
g-boun...@forums.jsoftware.com > [mailto:programming-boun...@forums.jsoftware.com] Namens Marshall > Lochbaum > Verzonden: zondag 22 juli 2012 22:05 > Aan: programm...@jsoftware.com > Onderwerp: Re: [Jprogramming] Verbs that contain nouns > > There is, in fact. Simply execute the nam

Re: [Jprogramming] Verbs that contain nouns

2012-07-22 Thread Marshall Lochbaum
There is, in fact. Simply execute the name you want to evaluate: g =. ] >@{ ".@:('paths'"_) 'paths'"_ is the verb that always returns the string 'paths', so ".@:('paths'"_) is the verb that always returns the current value of paths. The "strings are code" mentality feels ugly to someone used to C o

Re: [Jprogramming] Verbs that contain nouns

2012-07-22 Thread Kenneth Lettow
Hey Rick, Are you here in Toronto? I think a large group is meeting up at the Spotted Dick Pub, across from the Marriott near the Conference location. I will be there a little later, probably around 8pm. Hopefully we'll see you there. Ken On Sun, Jul 22, 2012 at 1:48 PM, Ric Sherlock wrote: >

Re: [Jprogramming] Verbs that contain nouns

2012-07-22 Thread Edward Mokurai Cherlin
http://jsoftware.com/help/learning/11.htm Learning J Chapter 11: Tacit Verbs Concluded 11.5 Parametric Functions The following example shows the consequences of nouns being evaluated and verbs not in an expression for a tacit verb. A curve may be specified by an equation such as, for e

Re: [Jprogramming] Verbs that contain nouns

2012-07-22 Thread David Vaughan
Thanks. So there's no way to achieve it with a tacit verb? On 22 Jul 2012, at 18:48, Ric Sherlock wrote: > When you assign a Tacit verb to a name the value of the nouns in the > definition are "compiled" in to the tacit definition. If you use an > explicit definition the noun will be reevaluate

Re: [Jprogramming] Verbs that contain nouns

2012-07-22 Thread Brian Schott
Ric, Thanks for that fact, which I never new. On Sun, Jul 22, 2012 at 1:48 PM, Ric Sherlock wrote: > When you assign a Tacit verb to a name the value of the nouns in the > definition are "compiled" in to the tacit definition. If you use an > explicit definition the noun will be reevaluate d each

Re: [Jprogramming] Verbs that contain nouns

2012-07-22 Thread Ric Sherlock
When you assign a Tacit verb to a name the value of the nouns in the definition are "compiled" in to the tacit definition. If you use an explicit definition the noun will be reevaluate d each time. On Jul 22, 2012 1:32 PM, "David Vaughan" wrote: > I have a noun called paths, whose value changes a

[Jprogramming] Verbs that contain nouns

2012-07-22 Thread David Vaughan
I have a noun called paths, whose value changes at various points, and a verb g that uses paths. The problem is, it only works for the initial value of paths. paths =: \:~&.> (;~ 0$0) , <\ 2+i.7 paths ┌┬┬─┬───┬─┬───┬─┬───┬─┐ │││2│3 2│4 3 2│5 4 3 2│6 5 4 3