Re: [Jprogramming] Trains: past, present and ...

2017-10-26 Thread Jose Mario Quintana
t0=. ((;:'tC0') , ])hg (i.2 2) +/ template t0 i.3 0 1 2 3 1 2 3 4 3 4 5 6 On Wed, Oct 25, 2017 at 8:47 PM, Raul Miller wrote: > I agree. (Well, ... except that modifying words like "easily" are not > actually quantifiable and tend to refer to concepts which are highly > variable.) > >

Re: [Jprogramming] Trains: past, present and ...

2017-10-25 Thread Raul Miller
I agree. (Well, ... except that modifying words like "easily" are not actually quantifiable and tend to refer to concepts which are highly variable.) Thanks, -- Raul On Wed, Oct 25, 2017 at 8:06 PM, Jose Mario Quintana wrote: > A tacit version of the adverb t0 can easily be produced via hg.

Re: [Jprogramming] Trains: past, present and ...

2017-10-25 Thread Jose Mario Quintana
A tacit version of the adverb t0 can easily be produced via hg. However, it would be a faithful alternative, meaning it will produce tC0 with a bonded argument, just as t0 does. If the goal is to do the whole thing tacitly that would be another matter. It could get messy because tC0 is a conjunc

Re: [Jprogramming] Trains: past, present and ...

2017-10-25 Thread Raul Miller
Ok, but this gets into the question of whether constructs mixing tacit and explicit mechanisms are tacit or explicit. Thanks, -- Raul On Wed, Oct 25, 2017 at 5:47 PM, Jose Mario Quintana wrote: > The key word is "allowed." For example, > > >* ┌─┐ > │*│ > └─┘ >X=. * >2 (>X) 3 >

Re: [Jprogramming] Trains: past, present and ...

2017-10-25 Thread Raul Miller
Sure, here's one example: s0=: 1 :'m"_^:((<''0:'')=])"0 L:1' s1=: 1 :'m"_^:((<''1:'')=])"0 L:1' template=: 0:&.>/\.&.(,&1:)&.|.&.(<"_1) a0 t0=:1 :0 tC0 m ) tC0=:2 :0 : ((<(0;1;0){::( wrote: > " > Consider, for example, using the 0: and 1: verbs as placeholders in a > gerund and substituting

Re: [Jprogramming] Trains: past, present and ...

2017-10-25 Thread Jose Mario Quintana
The key word is "allowed." For example, * X) 3 6 Of course, they can break the rules, t3=. 1 : 'x wrote: > On Wed, Oct 25, 2017 at 4:51 PM, Jose Mario Quintana > wrote: > > Not necessarily, explicit adverbs can do whatever a (v hg) adverb can; > > however, (v adv) can do things that e

Re: [Jprogramming] Trains: past, present and ...

2017-10-25 Thread Jose Mario Quintana
" Consider, for example, using the 0: and 1: verbs as placeholders in a gerund and substituting in a verb for the 0: argument and a boxed copy of a noun for the 1: argument in this gerund template: 0:&.>/\.&.(,&1:)&.|.&.(<"_1) a0 hg gives us a way of defining these transformations as verbs, but we

Re: [Jprogramming] Trains: past, present and ...

2017-10-25 Thread Raul Miller
On Wed, Oct 25, 2017 at 4:51 PM, Jose Mario Quintana wrote: > Not necessarily, explicit adverbs can do whatever a (v hg) adverb can; > however, (v adv) can do things that explicit adverbs are not allowed to do. Are you sure? If by "do" you mean something about the details of how the adverb is st

Re: [Jprogramming] Trains: past, present and ...

2017-10-25 Thread Jose Mario Quintana
"Atomic representation is structurally similar to J's internal representation, though, and as it is an executable form (albeit one that needs a bit more interpretation than the internal representation), it also qualifies as an intermediate form. Converting from atomic representation to internal for

Re: [Jprogramming] Trains: past, present and ...

2017-10-25 Thread Jose Mario Quintana
Hi EH> EH> It seems there are some more possibilities with your solutions. You are Not necessarily, explicit adverbs can do whatever a (v hg) adverb can; however, (v adv) can do things that explicit adverbs are not allowed to do. EH> doing some kind of program generation? Usually, I am. EH> It

Re: [Jprogramming] Trains: past, present and ...

2017-10-25 Thread Erling Hellenäs
   ('+';'/';'%';'#') `:6 +/ % #    ('+';'/';'%';'#') `:6[ 1 2 3 2    ('+';'/';'%';'#') ┌─┬─┬─┬─┐ │+│/│%│#│ └─┴─┴─┴─┘ /Erling On 2017-10-25 20:25, Raul Miller wrote: It is, in fact, picky but yes: your example here does not illustrate that pickiness. Also, (`:6) supports parsing sequences of rep

Re: [Jprogramming] Trains: past, present and ...

2017-10-25 Thread Raul Miller
It is, in fact, picky but yes: your example here does not illustrate that pickiness. Also, (`:6) supports parsing sequences of representations and also supports representations of the result of parsing those sequences. This is similar to how both 1+1 and 2 can represent the same value in mathemat

Re: [Jprogramming] Trains: past, present and ...

2017-10-25 Thread Erling Hellenäs
Hi all! It does not seem picky about the representation.    atomic =:[: 5!:1 <    boxed =: [: 5!:2 <    f=: +/ % #    (atomic'f') `:6 +/ % #    (boxed'f') `:6 +/ % #    atomic'f' ┌─┐ │┌─┬─┐│ ││3│┌───┬─┬─┐││ ││ ││┌─┬───┐│%│#│││ ││ │││/│┌─┐││ │ │││ ││ │││ ││+│││ │ │

Re: [Jprogramming] Trains: past, present and ...

2017-10-25 Thread Raul Miller
On Wed, Oct 25, 2017 at 12:23 PM, Jose Mario Quintana wrote: > RM> That said, describing the purpose of hg (and why one would want to use > RM> hg instead of av) is eluding me at the moment. Maybe when I wake up > RM> some more I would be better prepared to address this. > > The hg specification s

Re: [Jprogramming] Trains: past, present and ...

2017-10-25 Thread Jose Mario Quintana
RM> That said, describing the purpose of hg (and why one would want to use RM> hg instead of av) is eluding me at the moment. Maybe when I wake up RM> some more I would be better prepared to address this. The hg specification states that the argument for the workhorse verb is the atomic representa

Re: [Jprogramming] Trains: past, present and ...

2017-10-25 Thread Raul Miller
Yes, sort of, you are building atomic representations there. Note also that the box drawing characters are used to represent structure - you did not supply them as literals. But, take a look at t.c in the J engine source code to see an initial hint about what I am really talking about. Note also t

Re: [Jprogramming] Trains: past, present and ...

2017-10-25 Thread Erling Hellenäs
Hi all ! This post describes what I call the ascii representation. http://www.jsoftware.com/pipermail/programming/2017-October/049324.html An example:    ((<('+';'/');'%';'#'))(`:6) 1 2 3 2    ((<('+';'/');'%';'#')) ┌───┐ │┌─┬─┬─┐│ ││┌─┬─┐│%│#││ │││+│/││ │ ││ ││└─┴─┘│ │ ││ │└─

Re: [Jprogramming] Trains: past, present and ...

2017-10-25 Thread Raul Miller
I think you've introduced some false dichotomies here. First off, it's true that the J implementation is an interpreter, and it does not compile J to native code. Instead, it compiles J to an intermediate form which includes some ascii and some data structures. The displayed form represents those

Re: [Jprogramming] Trains: past, present and ...

2017-10-25 Thread Erling Hellenäs
Hi all! It seems there are some more possibilities with your solutions. You are doing some kind of program generation? It has similarities with having functions as primary citizens, but it is not the same because it does not happen at runtime? What is passed is ascii representations of function

Re: [Jprogramming] Trains: past, present and ...

2017-10-24 Thread Jose Mario Quintana
Typical explicit adverbs produce the result of a sentence where the argument replaces its corresponding parameter (usually u). In that sense, an adverb is similar to a macro but there are other possibilities; for instance, the adverb t1, t1=. ([ , (<'@:') , ])/o |. o (('';1)&{::)hg u0`u1`u

Re: [Jprogramming] Trains: past, present and ...

2017-10-24 Thread Erling Hellenäs
See comments below: Den 2017-10-24 kl. 07:14, skrev Jose Mario Quintana: EH> Hi all! Hi EH> All user-written adverbs and conjunctions are something similar to the EH> macros in assembler and C++? I am not familiar with modern macros but if macros have an arbitrary but fixed number of paramet

Re: [Jprogramming] Trains: past, present and ...

2017-10-24 Thread Raul Miller
Ok.. I have manage to convince myself that my earlier "cheating hypothesis" was utterly false. (And, Jose has stated something similar.) One trick is to realize that most of the adverbs used in building hg are not used directly, but instead are used for their atomic representations. They are sub-t

Re: [Jprogramming] Trains: past, present and ...

2017-10-24 Thread Rob Hodgkinson
Further test to this group, please ignore this email …/Rob H > On 24 Oct 2017, at 9:45 am, Roger Hui wrote: > > ​> (with their wives, so it was Ken & Jean and Eugene & Jeanne). > > From Eugene McDonnell Quotations and Anecdotes > > >

Re: [Jprogramming] Trains: past, present and ...

2017-10-23 Thread Jose Mario Quintana
EH> Hi all! Hi EH> All user-written adverbs and conjunctions are something similar to the EH> macros in assembler and C++? I am not familiar with modern macros but if macros have an arbitrary but fixed number of parameters then the answer is: not necessarily. EH> There are external interfaces.

Re: [Jprogramming] Trains: past, present and ...

2017-10-23 Thread Roger Hui
​> (with their wives, so it was Ken & Jean and Eugene & Jeanne). From Eugene McDonnell Quotations and Anecdotes • When Eugene and Ken Iverson went on vacation together with their wives, it’s “Genes” all around: Gene McDonnell, Jeanne McDo

Re: [Jprogramming] Trains: past, present and ...

2017-10-22 Thread Raul Miller
Thinking about this further - I am not sure that a3 (and, thus a6) work quite like I had previously suggested. Or, maybe they do, but... Ok, let's start over: Hypothetically speaking, av is almost our adverb that transforms a gerund manipulating verb into an adverb which performs that transformat

Re: [Jprogramming] Trains: past, present and ...

2017-10-21 Thread Rob Hodgkinson
A (firsthand) background note here, that Ken & Eugene were flying together to APL88 in Sydney (with their wives, so it was Ken & Jean and Eugene & Jeanne). They switched their seats and sat together and chatted and ended up having little sleep for the 16 hours trans pacific flight. Their discuss

Re: [Jprogramming] Trains: past, present and ...

2017-10-21 Thread Erling Hellenäs
   1 (<'+')(`:6) 3 4    ((<('+';'/')))(`:6) 1 2 3 6    ((<('+';'/');'%';'#'))(`:6) 1 2 3 2    (< (<'-');'@:';<(<'+:')) (`:6)1 2 3 _2 _4 _6 /Erling On 2017-10-21 23:25, Raul Miller wrote: Ok... i do not know how to approach this without reviewing basics, so... bear with me. The question is how

Re: [Jprogramming] Trains: past, present and ...

2017-10-21 Thread Raul Miller
Ok... i do not know how to approach this without reviewing basics, so... bear with me. The question is how does a3 work. And, a3 is: a3=: (@: (aw f.)) av aw extracts the left tine of the gerund of a train or analogous sequence: 9!:3]1 5 NB. show both atomic and linear representations

Re: [Jprogramming] Trains: past, present and ...

2017-10-21 Thread 'Pascal Jasmin' via Programming
r 21, 2017 8:03 AM Subject: Re: [Jprogramming] Trains: past, present and ... Pepe, if you would add that bug, whatever it is, to http://code.jsoftware.com/wiki/System/Interpreter/Bugs/Errors I'd be obliged. Henry Rich On 10/21/2017 7:55 AM, Jose Mario Quintana wrote: > Hi Erlin

Re: [Jprogramming] Trains: past, present and ...

2017-10-21 Thread Erling Hellenäs
Hi all ! I do my best to understand this. Like Raul I name things. I created some explanations. However, I didn't manage to understand how a3 and a6 works. Maybe someone can help? My project: 9!:14'' o=: @: ar=: 5!:1 @:< ar 'o' emptyGerund=: `'' emptyGerund DoOnLeftArgAdverb=: (@:[) ((

Re: [Jprogramming] Trains: past, present and ...

2017-10-21 Thread Erling Hellenäs
My a2 name :)     InfinityAdverb=: (`(<(":0);_)) (`:6) %InfinityAdverb 0 /Erling On 2017-10-21 20:45, Raul Miller wrote: Here's one issue: 1 2 3 *: av 1 4 9 load'debug/dissect' dissect '1 2 3 *: av' Syntax error: invalid sequence Noun Verb Error snippet: 1 2 3 *: av But that's

Re: [Jprogramming] Trains: past, present and ...

2017-10-21 Thread Erling Hellenäs
Hi all! I don't understand the meaning of "tacit adverb". Before parsing of the actual tacit trains, all adverbs and conjunctions are tied to their arguments? What remains is a verb train to be parsed? A verb train which contains some built-in adverbs and conjunctions? These are tied to their

Re: [Jprogramming] Trains: past, present and ...

2017-10-21 Thread Jose Mario Quintana
(a2=. (`(<(":0);_)) (`:6)) > >> av=. ((ar'a0')`) (`(ar'a1')) (`(ar'a2') ) (`:6) > >> ... > >> > >> What you did is equivalent, thanks. > >> > >> The first part runs fine using the latest "stable" off

Re: [Jprogramming] Trains: past, present and ...

2017-10-21 Thread Raul Miller
hought experiment" was >> run using Jx). >> >> >> >> >> On Sat, Oct 21, 2017 at 7:30 AM, Jose Mario Quintana < >> jose.mario.quint...@gmail.com> wrote: >> >>> Look carefully at my first post [0] as I suggested (using a browser), the >&

Re: [Jprogramming] Trains: past, present and ...

2017-10-21 Thread Jose Mario Quintana
Indeed, one can produce many useful tacit adverbs by other means. However, is there a general method to produce tacit adverbs using current official interpreters? If worse comes to worse, the adverb hg provides the means do to so for a vast class of adverbs (yet, there are still, at least, a coup

Re: [Jprogramming] Trains: past, present and ...

2017-10-21 Thread Raul Miller
s response > ((`'')(((@:[)(&`))(`:6)))((`_)(`:6)) and the next line, > > av=. ((ar'a0')`) (`(ar'a1')) (`(ar'a2') ) (`:6) > > is where ar'a2' is used. > > > [0] [Jprogramming] Trains: past, present and ... Jose Mario Qu

Re: [Jprogramming] Trains: past, present and ...

2017-10-21 Thread Raul Miller
That worked for me, 1: [^:('0:'-:])L:0&(>:@0:a0) hg >:@1: Thanks, -- Raul On Sat, Oct 21, 2017 at 6:32 AM, Erling Hellenäs wrote: > Hi all! > > I commented a printout that did not seem to work and modified the script > slightly while hopefully keeping its function. > > 9!:14'' > o=. @: >

Re: [Jprogramming] Trains: past, present and ...

2017-10-21 Thread Erling Hellenäs
Hi all! Since the full answers to these seemingly stupid questions are not clear to me, I will pose them: 1. Why shouldn't we just write the adverbs and conjunctions instead of producing them this way? 2. How does this  way to do it compare to creating programs from strings with Do(".) ?  

Re: [Jprogramming] Trains: past, present and ...

2017-10-21 Thread Jose Mario Quintana
gt; On Sat, Oct 21, 2017 at 7:30 AM, Jose Mario Quintana < >> jose.mario.quint...@gmail.com> wrote: >> >> Look carefully at my first post [0] as I suggested (using a browser), the >>> line, >>> >>> (a0=. `'') (a1=. (@:[) ((<'&&#

Re: [Jprogramming] Trains: past, present and ...

2017-10-21 Thread Henry Rich
first post [0] as I suggested (using a browser), the line, (a0=. `'') (a1=. (@:[) ((<'&')`) (`:6)) (a2=. (`(<(":0);_)) (`:6)) defines a0, a1 and a2, the next line is J's response ((`'')(((@:[)(&`))(`:6)))((`_)(`:6)) and the next line, av=

Re: [Jprogramming] Trains: past, present and ...

2017-10-21 Thread Jose Mario Quintana
7 at 7:30 AM, Jose Mario Quintana < > jose.mario.quint...@gmail.com> wrote: > >> Look carefully at my first post [0] as I suggested (using a browser), the >> line, >> >>(a0=. `'') (a1=. (@:[) ((<'&')`) (`:6)) (a2=. (`(<(":0);_)) (`:6)

Re: [Jprogramming] Trains: past, present and ...

2017-10-21 Thread Jose Mario Quintana
a1 and a2, the next line is J's response > ((`'')(((@:[)(&`))(`:6)))((`_)(`:6)) and the next line, > >av=. ((ar'a0')`) (`(ar'a1')) (`(ar'a2') ) (`:6) > > is where ar'a2' is used. > > > [0] [Jprogramming] Trains: past,

Re: [Jprogramming] Trains: past, present and ...

2017-10-21 Thread Erling Hellenäs
After executing the modified script the examples in the post worked and I could read it. /Erling On 2017-10-21 12:32, Erling Hellenäs wrote: Hi all! I commented a printout that did not seem to work and modified the script slightly while hopefully keeping its function. 9!:14'' o=. @: ar=. 5!

Re: [Jprogramming] Trains: past, present and ...

2017-10-21 Thread Jose Mario Quintana
:6)) and the next line, av=. ((ar'a0')`) (`(ar'a1')) (`(ar'a2') ) (`:6) is where ar'a2' is used. [0] [Jprogramming] Trains: past, present and ... Jose Mario Quintana http://www.jsoftware.com/pipermail/programming/2017-October/049263.html On Fri, Oct 2

Re: [Jprogramming] Trains: past, present and ...

2017-10-21 Thread Erling Hellenäs
Hi all! I commented a printout that did not seem to work and modified the script slightly while hopefully keeping its function. 9!:14'' o=. @: ar=. 5!:1 @:< a0=. `'' a1=. (@:[) ((<'&')`) (`:6) a2=. (`(<(":0);_)) (`:6) NB.(a0=. `'') (a1=. (@:[) ((<'&')`) (`:6)) (a2=. (`(<(":0);_)) (`:6)) ((`''

Re: [Jprogramming] Trains: past, present and ...

2017-10-21 Thread Erling Hellenäs
Hi Jose ! I have to install an old release? There seem to be a one item gerund notation it does not accept if the item is a conjunction.     9!:14'' j806/j64/windows/beta/BEST/Jx-patches/2017-10-06T14:44:47 This one is from your post. Where it crashes:    &` |syntax error |   &` My addi

Re: [Jprogramming] Trains: past, present and ...

2017-10-20 Thread Raul Miller
Please re-read my message? Yes, the line quoted in my error message got wrapped. However, I have no reason [yet] to believe that it was incomplete. But... your quoting of that error message wrapped it further for me. I do not know if that wrapping happened before you got my message or after. But

Re: [Jprogramming] Trains: past, present and ...

2017-10-20 Thread Jose Mario Quintana
No, a2 is defined previously; recall "beware of line-wrapping." In addition, what I showed was a session output, not a clean script. If your email formatting is giving you a hard time, try to look at the version of my post in the forum archive. I hope it helps On Thu, Oct 19, 2017 at 8:31 PM,

Re: [Jprogramming] Trains: past, present and ...

2017-10-19 Thread Raul Miller
When I try to execute your script, I get: |value error: a2 | (a0=.`'')(a1=.(@:[)((<'&')`)(`:6))(a2=.(`(<(":0);_))(`:6))((`'')(((@:[)(&`))(`:6)))((`_)(`:6))av=.((ar'a0')`)(`(ar'a1'))(`( ar'a2'))(`:6) |[-3] /users/rauldmiller/j64-805-user/temp/2.ijs 9!:14'' j805/j64/darwin/beta-9/commercial

[Jprogramming] Trains: past, present and ...

2017-10-19 Thread Jose Mario Quintana
There were many adverb and conjunction producing trains during a period which Henry has referred as the Golden Age. Some were available as early as 1993 [0] and several more afterward [1]. A few of those adverb producing trains (all of them bidents) survived [2] (using nv to denote noun or verb),

Re: [Jprogramming] trains

2014-07-19 Thread Linda Alvord
ubject: Re: [Jprogramming] trains putting spacing for fork groups  g is equivalent to  (* * (* (* * *) (* * *))) From: Don Guinn To: Programming forum Sent: Friday, July 18, 2014 10:15:02 PM Subject: Re: [Jprogramming] trains In the case of f you have three fo

Re: [Jprogramming] trains

2014-07-18 Thread Gilles Kirouac
The first train I used has been given by Chris: getting the shape and the value (in a console, when you don't have a fancy GUI à la Dyalog). ($;]) a ┌─┬─┐ │1│0│ └─┴─┘ But, Daniel, have you looked at the Phrases? You'll find hundreds of them classified by application type in about fift

Re: [Jprogramming] trains

2014-07-18 Thread bill lam
>3 (f-:g) 4 > 0 > >3 (f-:h) 4 > 1 > >3 (g-:h) 4 > 0 > > Linda > > > -Original Message- > From: programming-boun...@forums.jsoftware.com > [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of chris burke > Sent: Friday, Jul

Re: [Jprogramming] trains

2014-07-18 Thread 'Pascal Jasmin' via Programming
putting spacing for fork groups  g is equivalent to  (* * (* (* * *) (* * *))) From: Don Guinn To: Programming forum Sent: Friday, July 18, 2014 10:15:02 PM Subject: Re: [Jprogramming] trains In the case of f you have three forks - each (***) which  combine

Re: [Jprogramming] trains

2014-07-18 Thread Linda Alvord
: [Jprogramming] trains In the case of f you have three forks - each (***) which combine to make a fork. In the case of g you have the two (***) combined with the last * not in parens making a fork which then combines with the other two * making a fork. The outer parens show that middle fork. On Fri, Jul 18

Re: [Jprogramming] trains

2014-07-18 Thread Don Guinn
oftware.com] On Behalf Of Don Guinn > Sent: Friday, July 18, 2014 6:08 PM > To: Programming forum > Subject: Re: [Jprogramming] trains > > g is equivalent to >**(*(***)(***)) > > > On Fri, Jul 18, 2014 at 4:00 PM, Linda Alvord > wrote: > > > C

Re: [Jprogramming] trains

2014-07-18 Thread Linda Alvord
08 PM To: Programming forum Subject: Re: [Jprogramming] trains g is equivalent to **(*(***)(***)) On Fri, Jul 18, 2014 at 4:00 PM, Linda Alvord wrote: > Can you use a single phrase that explains this behavior? > >f=:(***)(***)(***) >g=:***(***)(***) >h=:(***)(***)*

Re: [Jprogramming] trains

2014-07-18 Thread Don Guinn
h) 4 > 1 > >3 (g-:h) 4 > 0 > > Linda > > > -Original Message- > From: programming-boun...@forums.jsoftware.com > [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of chris burke > Sent: Friday, July 18, 2014 1:31 PM > To: Programming

Re: [Jprogramming] trains

2014-07-18 Thread Linda Alvord
...@forums.jsoftware.com] On Behalf Of chris burke Sent: Friday, July 18, 2014 1:31 PM To: Programming forum Subject: Re: [Jprogramming] trains Often useful with link: (#;$;]) i.3 4 +-+---+-+ |3|3 4|0 1 2 3| | | |4 5 6 7| | | |8 9 10 11| +-+---+-+ On Wed, Jul 16, 2014

Re: [Jprogramming] trains

2014-07-18 Thread Kip Murray
a > > -Original Message- > From: programming-boun...@forums.jsoftware.com [mailto: > programming-boun...@forums.jsoftware.com ] On Behalf Of > Raul Miller > Sent: Friday, July 18, 2014 12:40 PM > To: Programming forum > Subject: Re: [Jprogramming] trains > > I am

Re: [Jprogramming] trains

2014-07-18 Thread Linda Alvord
t: Friday, July 18, 2014 12:40 PM To: Programming forum Subject: Re: [Jprogramming] trains I am trying to think of a case where commutative intersect on bags makes sense. It seems to me that in any case where I want commutativity for that kind of operation I'd want to be working with eit

Re: [Jprogramming] trains

2014-07-18 Thread chris burke
Often useful with link: (#;$;]) i.3 4 +-+---+-+ |3|3 4|0 1 2 3| | | |4 5 6 7| | | |8 9 10 11| +-+---+-+ On Wed, Jul 16, 2014 at 1:26 PM, 'Dan Baronet' via Programming < programm...@jsoftware.com> wrote: > I am looking for good examples of use of trains. > Apart

Re: [Jprogramming] trains

2014-07-18 Thread Raul Miller
* > > >> L---+ -- * > > >> L---+- * > > >> L- * > > >> > > >>h=:** > > >> > > >>5!:4 <'h' > > >> > > >> -- * > >

Re: [Jprogramming] trains

2014-07-18 Thread Alex Giannakopoulos
* > >> > >>5!:4 <'h' > >> > >> -- * > >> │ -- * > >> --+ +- * > >> L---+ -- * > >> │ +- * > >> L---+ -- * > >> │ +- * > >> L---+ -- * > &

Re: [Jprogramming] trains

2014-07-18 Thread Raul Miller
* >> >> >> >> >> >>i=:***(***) >> >>5!:4 <'i' >> >> -- * >> │ -- * >> --+ +- * >> │ │ -- * >> L---+ +- * >> │ │ L- * >> L---+- * >

Re: [Jprogramming] trains

2014-07-18 Thread Tracy Harms
On Jul 16, 2014 10:49 PM, "Marshall Lochbaum" wrote: > > It's weird to ask for an example of a train since forks are such a > common part of J. If you look at almost any substantial piece of code > you'll be swimming in them in short order. > > Marshall I had the same reaction. Trains are the def

Re: [Jprogramming] trains

2014-07-18 Thread Linda Alvord
amming-boun...@forums.jsoftware.com [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Alex Giannakopoulos Sent: Friday, July 18, 2014 8:38 AM To: J Programming forum Subject: Re: [Jprogramming] trains Just a teeny comment if I may: The "set intersection" fork posted abov

Re: [Jprogramming] trains

2014-07-18 Thread Alex Giannakopoulos
--+ +- * > │ │ L- * > L---+- * > │ -- * > L---+- * > L- * > > > > 16 > >j=:(***)(***)*** > > 5!:4 <'j' > > -- * > --+- * > │ L- * > │ > │ -- * > -

Re: [Jprogramming] trains

2014-07-17 Thread Linda Alvord
rums.jsoftware.com [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of R.E. Boss Sent: Thursday, July 17, 2014 12:17 PM To: programm...@jsoftware.com Subject: Re: [Jprogramming] trains From http://www.jsoftware.com/help/dictionary/dacapdot.htm $(i.@! <@A. i.)5 120 (

Re: [Jprogramming] trains

2014-07-17 Thread R.E. Boss
t; From: programming-boun...@forums.jsoftware.com [mailto:programming- > boun...@forums.jsoftware.com] On Behalf Of Devon McCormick > Sent: donderdag 17 juli 2014 17:09 > To: J-programming forum > Subject: Re: [Jprogramming] trains > > Sorry - "All anagrams" should be this: > >

Re: [Jprogramming] trains

2014-07-17 Thread Devon McCormick
; ''to'' nl 0 3' (cocurrent@] ".@] [)"1 0 ;: 'j z' >> >> in all locales >> >> ' ''to'' nl 0 3' inl nl 6 >> >> with helpful locale name in left column >> >> ' ''to&#

Re: [Jprogramming] trains

2014-07-17 Thread Devon McCormick
7; ''to'' nl 0 3'(] ,. (cocurrent@] ".@] [)"1 0) nl 6 > > > - Original Message - > From: Kip Murray > To: "programm...@jsoftware.com" > Cc: > Sent: Thursday, July 17, 2014 9:34:45 AM > Subject: Re: [Jprogramming]

Re: [Jprogramming] trains

2014-07-17 Thread 'Pascal Jasmin' via Programming
] [)"1 0 ;: 'j z' in all locales ' ''to'' nl 0 3' inl nl 6 with helpful locale name in left column ' ''to'' nl 0 3'(] ,. (cocurrent@] ".@] [)"1 0) nl 6 - Original Message - From: Kip Murray To

Re: [Jprogramming] trains

2014-07-17 Thread 'Pascal Jasmin' via Programming
] [)"1 0 ;: 'j z' in all locales ' ''to'' nl 0 3' inl nl 6 with helpful locale name in left column ' ''to'' nl 0 3'(] ,. (cocurrent@] ".@] [)"1 0) nl 6 - Original Message - From: Kip Murray To

Re: [Jprogramming] trains

2014-07-17 Thread Kip Murray
en =: [: %: [: +/ *: NB. Euclidian norm sn =: [: >./ |NB. Sup Norm tn =: [: +/ | NB. Taxicab Norm v =: 4 _2 1 _10 en v 11 sn v 10 tn v 17 On Thursday, July 17, 2014, Brian Schott wrote: > Consider the dyadic forks wmean and wmean1 discussed in the followin

Re: [Jprogramming] trains

2014-07-17 Thread Brian Schott
Consider the dyadic forks wmean and wmean1 discussed in the following message. wmean =: * %&(+/)[ NB. weighted mean wmean1=: # %&(+/) [ http://www.jsoftware.com/pipermail/programming/2009-February/013728.html -- (B=) -- For i

Re: [Jprogramming] trains

2014-07-17 Thread Ben Gorte - CITG
6 6 7 7 7 Ben From: programming-boun...@forums.jsoftware.com [programming-boun...@forums.jsoftware.com] on behalf of 'Dan Baronet' via Programming [programm...@jsoftware.com] Sent: Thursday, July 17, 2014 13:57 To: programm...@jsoftware.com Subject: Re: [Jprogramming] trains interesting o

Re: [Jprogramming] trains

2014-07-17 Thread 'Dan Baronet' via Programming
interesting one, thanks On Wednesday, July 16, 2014 7:50:39 PM, Nollaig MacKenzie wrote: last1=: $ #: , i: 1:   bar   1 1 0 0   1 0 1 0   0 1 1 1   1 0 1 0   1 1 1 0   1 1 1 0       last1 bar       1 2 2       On 2014.07.16 13:26:38, you, the extraordinary 'Dan Baronet' via Prog

Re: [Jprogramming] trains

2014-07-16 Thread Rob Hodgkinson
Examples ... Forgive iphone typos... Open, close of prices and range... nos=.2 3 5 8 13 21 openclose=.{. , {: range=.>./ - <./ openclose nos 2 21 range nos 19 Statistics (original courtesy of Keith Smillie, these are broken down) am =: +/ % # NB. Arithmetic mean gm =: # %: */

Re: [Jprogramming] trains

2014-07-16 Thread Marshall Lochbaum
A nice one is histogram: hist =: ~. ,. #/.~ hist 4 2 5 4 2 6 1 5 2 6 2 4 2 2 4 5 2 6 2 1 1 It's weird to ask for an example of a train since forks are such a common part of J. If you look at almost any substantial piece of code you'll be swimming in them in short order. Marshall On Wed, J

Re: [Jprogramming] trains

2014-07-16 Thread Linda Alvord
+- , L- ] Linda -Original Message- From: programming-boun...@forums.jsoftware.com [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Devon McCormick Sent: Wednesday, July 16, 2014 5:36 PM To: J-pro

Re: [Jprogramming] trains

2014-07-16 Thread 'Pascal Jasmin' via Programming
({.,&< }.) ;/ i.4 ┌───┬───┐ │┌─┐│┌─┬─┬─┐│ ││0│││1│2│3││ │└─┘│└─┴─┴─┘│ └───┴───┘ ,&< provides a consistent result whether or not argument is boxed items. Which made me wonder, why is split defined as with ,&< instead of the simpler ; -- or so it seems? --

Re: [Jprogramming] trains

2014-07-16 Thread Nollaig MacKenzie
last1=: $ #: , i: 1: bar 1 1 0 0 1 0 1 0 0 1 1 1 1 0 1 0 1 1 1 0 1 1 1 0 last1 bar 1 2 2 On 2014.07.16 13:26:38, you, the extraordinary 'Dan Baronet' via Programming, spake thus: > I am looking for good examples of use of trains. > Apart from the class

Re: [Jprogramming] trains

2014-07-16 Thread Joe Bogner
It can be useful for testing equivalency (({.;}.) -: split) 'abcd' 1 (({.;}.) -: split) (1 2 3 4) 1 (({.;}.) -: split) (i. 2 3 4) 1 Which made me wonder, why is split defined as with ,&< instead of the simpler ; -- or so it seems? @Raul - the intersect example was quite interesting to m

Re: [Jprogramming] trains

2014-07-16 Thread 'Dan Baronet' via Programming
I don't care. Good example. /D On Wednesday, July 16, 2014 6:29:48 PM, Raul Miller wrote: Do you care what the trains are used for? One of the classic trains is set intersection: intersect=: [ -. -. Thanks, -- Raul On Wed, Jul 16, 2014 at 4:26 PM, 'Dan Baronet' via Programming wrote

Re: [Jprogramming] trains

2014-07-16 Thread Raul Miller
Do you care what the trains are used for? One of the classic trains is set intersection: intersect=: [ -. -. Thanks, -- Raul On Wed, Jul 16, 2014 at 4:26 PM, 'Dan Baronet' via Programming wrote: > I am looking for good examples of use of trains. > Apart from the classic +/ % #, I can't thin

Re: [Jprogramming] trains

2014-07-16 Thread Alex Giannakopoulos
Sorry, in the above post, I was referring to forks. Although most seem to be fond of forks, I have found hooks to be more useful and subtle (for my needs anyway). Tracy gave a great example. Basically the monadic case of the hook can be thought of as any variable combined with itself in some way

Re: [Jprogramming] trains

2014-07-16 Thread Devon McCormick
How about "split": {. ,&< }. ? On Wed, Jul 16, 2014 at 5:12 PM, Alex Giannakopoulos < aeg...@blueyonder.co.uk> wrote: > I suppose the most useful, from a beginner's point of view, is the cap > fork, e.g. > [: *: sin > which allows composition, and is equivalent to > *: @ sin > Some people pre

Re: [Jprogramming] trains

2014-07-16 Thread Alex Giannakopoulos
I suppose the most useful, from a beginner's point of view, is the cap fork, e.g. [: *: sin which allows composition, and is equivalent to *: @ sin Some people prefer this former notation as clearer than the latter. So, sin =: 1&o. cos =: 2&o. (([: *: sin) + [: *: cos) 9876543210 1 Basic

Re: [Jprogramming] trains

2014-07-16 Thread Tracy Harms
Among my favorites is filter, a.k.a. copy-where. It's any hook where the left tine is Reflexive Copy and the right is a qualifying boolean test. There are many examples at jsoftware.com retain_odd =: #~ 2&| -- T On Jul 16, 2014 4:26 PM, "'Dan Baronet' via Programming" < programm...@jsoftware.com>

Re: [Jprogramming] trains

2014-07-16 Thread 'Pascal Jasmin' via Programming
later with another function.  Forks provides a clean and terse way of doing so. - Original Message - From: 'Dan Baronet' via Programming To: "programm...@jsoftware.com" Cc: Sent: Wednesday, July 16, 2014 4:26:38 PM Subject: [Jprogramming] trains I am looking for goo

[Jprogramming] trains

2014-07-16 Thread 'Dan Baronet' via Programming
I am looking for good examples of use of trains. Apart from the classic +/ % #, I can't think of many more. Anyone with some examples? They can be of any length. /Dan -- For information about J forums see http://www.jsoftware.com/f

Re: [Jprogramming] Trains of verbs

2013-07-22 Thread Jose Mario Quintana
http://www.jsoftware.com/pipermail/general/2006-January/026271.html On Mon, Jul 22, 2013 at 7:00 AM, Raul Miller wrote: > If I recall correctly (and a quick search isn't finding me anything, > but we've discussed this previously in this forum), hooks were a > mistake - they were unnecessary cute

Re: [Jprogramming] Trains of verbs

2013-07-22 Thread Raul Miller
If I recall correctly (and a quick search isn't finding me anything, but we've discussed this previously in this forum), hooks were a mistake - they were unnecessary cuteness. But, now that we have them, we can't get rid of them - it would break too many things. That said, here's the dictionary pa

Re: [Jprogramming] Trains of verbs

2013-07-22 Thread Tobia Conforto
Thank you. I had tried to do something similar, but I couldn't come up with a decent ambivalent verb to use. Now for the big question. Even-numbered and odd-numbered dyadic trains behave very differently. Is there a purpose behind this difference? Or is it just a product of the other rules? I

Re: [Jprogramming] Trains of verbs

2013-07-21 Thread Raul Miller
That looks right, to me. Note that you can test this if you replace := with -: For example: x=: 1 y=: 2 a=:B=:c=:D=:e=:F=: <@,&< Thanks, -- Raul On Sun, Jul 21, 2013 at 7:53 PM, Tobia Conforto wrote: > Hello > > I'm trying to understand trains of verbs and I came up with this. Can anybody

[Jprogramming] Trains of verbs

2013-07-21 Thread Tobia Conforto
Hello I'm trying to understand trains of verbs and I came up with this. Can anybody please either confirm it or correct me? Monadic trains: (B a) y := y B (a y) (c B a) y := (c y) B (a y) (D c B a) y := y D (c y) B (a y)