Re: [Jprogramming] Such that syntax in J

2014-12-27 Thread Roger Stokes
Very well said. On 27/12/2014 07:46, Aai wrote: Sorry for jumping in late. The Haskell expression you showed here is called a list comprehansion which can be easily formulated as map f xs and this is in J simply: f xs Jon Hough schreef op 26-12-14 om 17:04: In Haskell (and other

Re: [Jprogramming] Such that syntax in J

2014-12-27 Thread Jon Hough
Hi Aai, I see what you are saying, but I would say that implicitly inside f there is some sort of such that syntax. My motivation for asking for a such that / where construct is to create computable math definitions, as in Haskell. for example, if I want the set (or group): { x e. Sym(4) |

Re: [Jprogramming] Such that syntax in J

2014-12-27 Thread Aai
Hello John, just interpreting what you mean (but I may misunderstand it completely). With a list comprehension you can formulate: (just a simple example) Prelude take 6 $ [ (^2) x | x - [0..], 0 == x `mod` 2] [0,4,16,36,64,100] In J: (*:#~0=2|) i.12 0 4 16 36 64 100 Perhaps something

Re: [Jprogramming] Such that syntax in J

2014-12-27 Thread Jon Hough
Hi Aai, I'm sorry, we may be talking past each other. You are correct abut list comprehensions, but I am interested in being able to get a such that idea in J, to make translating math definitions {A | B} (A such that B) into computable J. This isn't to make anything computationally faster or

Re: [Jprogramming] Such that syntax in J

2014-12-27 Thread Raul Miller
If I understand properly, the Haskell concept of such that is roughly analogous to the J concept of verb rank (which is a built in property of all J verbs). If this is the case, maybe what you want is already there? Thanks, -- Raul On Sat, Dec 27, 2014 at 10:01 AM, Jon Hough

Re: [Jprogramming] Such that syntax in J

2014-12-27 Thread 'Pascal Jasmin' via Programming
It seems that such that is indistinguishable (to me) with select. While I do not use a select utility adverb (I write out a # expression each time), making these utility adverbs is a great step in learning J, and making the language fit the concepts you already understand in your mind. With

Re: [Jprogramming] Such that syntax in J

2014-12-27 Thread Aai
Ok, I misinterpreted this enormously (I was just focused on the Haslell expression you started with). It would be nice if you could illustrate your last mail with an example in Haskell (but that's specifically for me). You started with the Haskell expression [ f x | x - xs ] and described

Re: [Jprogramming] Such that syntax in J

2014-12-27 Thread Stefano Lanzavecchia
https://www.haskell.org/haskellwiki/List_comprehension On 27 December 2014 at 18:31, Aai agroeneveld...@gmail.com wrote: Ok, I misinterpreted this enormously (I was just focused on the Haslell expression you started with). It would be nice if you could illustrate your last mail with an

Re: [Jprogramming] Such that syntax in J

2014-12-27 Thread Raul Miller
A purely haskell discussion, without any J code, probably belongs in the chat forum instead of this one. That said, I think the point was not list comprehensions, but a question about what aspect was being referred to *instead of* list comprehensions. That is, if I comprehend the messages which

Re: [Jprogramming] Such that syntax in J

2014-12-27 Thread Linda Alvord
Or: f=: [: *: : #~ 2 | ] f i.12 0 4 16 36 64 100 Linda -Original Message- From: programming-boun...@forums.jsoftware.com [mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Aai Sent: Saturday, December 27, 2014 12:32 PM To: programm...@jsoftware.com Subject: Re: