It may help if you think of the problem more as a math problem:

   load 'plot'
   x=:i:5
   x
_5 _4 _3 _2 _1 0 1 2 3 4 5
   plot y=:x^2

x is the data like "banana" is data, and it is a "noun".

f=:x^2 or y=:x^2 is a "verb" which tell what to do with the "noun".
Similarly you can say "eat the banana" or "cook the banana".

Looking at  J  as a way to create arrays of data and then process that data
to get what you want as an answer may keep you from getting too caught up in
language issues.

Linda

---=--Original Message-----
From: programming-boun...@jsoftware.com
[mailto:programming-boun...@jsoftware.com] On Behalf Of Kim Kuen Tang
Sent: Monday, August 15, 2011 5:09 AM
To: programming@jsoftware.com
Subject: [Jprogramming] Several questions about j


Hi everyone,

here are some newbie questions regarding the differences between j and kdb.

Are verbs ( dyad or monad)  first-class citizen in j?
Is it possible to forward a verb to another verb?
Is it possible to box a verb into list ?
Is it possible to have a dictionary like the case in kdb?  Something like :
(`a`b`c)!(1 2 3)

What i want to do in j is to program a verb (i will call it p) that will
accept a monad and output a plot of this monad.

For example:

f=. 3: 0 'y^2'
p=. (implementation)

p f will output the plot of f between -5 and 5.


Thanks for any comments and answers.

Reagrds,

Kim
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to