Phrases/AtomicRepresentation

From J Wiki
Jump to: navigation, search

Create Atomic Representations

NB. Atomic-representation utilities
NB. y. is string name of verb, result is AR of verb
arverb =: <@,
NB. y. is noun, result is AR of noun
arnoun =: <@((,'0')&(,&<))
NB. (adverb) m. is conjunction (in string form), x. is AR, y. is AR
NB. Result is AR of x. m. y.
arconj =: 1 : '<@((,&<~ ,)&m.)@,"0'
NB. y. is a list of 3 ARs, result is AR of their fork
arfork =: <@((,'3')&(,&:<))
NB. x. is AR, y. is AR, result is AR for (x. y.)
arhook =: <@((,'2')&(,&:<))@,"0