Pascal Jasmin wrote:
> I believe I have seen before a way to define both monad and
> dyad parts of a verb on the same line. Is there a way to have
> a single function that would return this verb?
> (nm,'@]')
> :
> ('[',nm,']')
This should work:
a:1 :(nm,'@]') :(a:1 :('[',nm,']')
That struck me as excessive bulk for a result,so I didn't go
that route.
Note also that this should work in j6.01, and is ambivalent
about verb valence:
refname=:4 :0
NB. x - name of member
NB. y - locale
nm=. x,'_',(":>y),'_'
)
v0=:2 :0
nm=.m refname n
".'dElEtEmE=:',nm
if.0=4!:0<'dElEtEmE' do.dElEtEmE=:".bind nm end.
nm2=.dElEtEmE
(5!:1<'nm2')5!:0
)
'a' v0 'base' NB. when (a) has verb syntax
a_base_
Caution: This won't work without at least temporary existence
of a non-local variable (in other words replacing both instances
of dElEtEmE=: with dElEtEmE=. will result in undesired behavior).
--
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm