How to list the verb code in J

In the console, typing one verb without parameters, displays its contents:

   tolower

3 : 0
x=. I. 26 > n=. ((65+i.26){a.) i. t=. ,y
($y) $ ((x{n) { (97+i.26){a.) x}t
)

This is good for development, but not possible at runtime. Is there a way to do this dynamically? Is there a verb that can return the contents of another verb?

For instance:

showverb 'tolower'

or

showverb tolower
+5
source share
1 answer

You can use the view. For example, the box view ( 5!:2) tolower:

   (5!:2) <'tolower'
β”Œβ”€β”¬β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚3β”‚:β”‚x=. I. 26 > n=. ((65+i.26){a.) i. t=. ,yβ”‚
β”‚ β”‚ β”‚($y) $ ((x{n) { (97+i.26){a.) x}t       β”‚
β””β”€β”΄β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

its linear ( 5!:5) is equal to:

   (5!:5) <'tolower'
3 : 0
x=. I. 26 > n=. ((65+i.26){a.) i. t=. ,y
($y) $ ((x{n) { (97+i.26){a.) x}t
)
+9
source

All Articles