m. 
Author Message
 m.


Murray Eisenberg writes on Tuesday, April 30:

Quote:
> What in the world is
>   m.
> in J 3.01?   I don't find it in the on-line or printed vocabulary.

The names m. n. u. v. are new to J3.01 and are described in the
dictionary entry for : and are in the index.  The description on
page 150 says:

 5. The names x. and y. denote the left and right arguments.
 In defining a conjunction [or adverb] it may be necessary to
 refer to _its_ left and right arguments (using u. and v.)
 as well as to the arguments of the resulting function
 (x. and y.).  The use of m. instead of u. restricts the
 corresponding argument to being a noun, as does the use of
 n. instead of v..

As an example of using these facilities, I offer the following model
of power (^:):

type  =. 3!:0
nc    =: 4!:0



inv   =: ^: _1

pow=: 2 : 0
 assert verb <'u.'
 if.     verb <'v.' do. u. powv v.
 elseif. boxed n.   do. u. powg n.
 elseif. 1          do. u. pown n.
 end.
)

powv=: 2 : 0
 u. pown (v. y.) y.
  :
 x. u. pown (x. v. y.) y.
)

pown=: 2 : 0

 elseif. 0>n. do. u. inv pown (-n.) y.
 elseif. 1 do.
  assert n.-:<.n.
  z=.y. [ t=.0-:y. [ i=._1
  while. (t-:z)<n.>i=.>:i do. z=.u. t=.z end.
 end.
  :
 x.&u. pown n. y.
)

powg=: 2 : 0
 assert ($n.) -: ,2
 v0=. (0{n.) \
 v1=. (1{n.) \
 u. pown (v0 y.) v1 y.
  :
 assert ($n.) -:"1 ,. 2 3
 n.=. _3}.'[';n.
 v0=. (0{n.) \
 v1=. (1{n.) \
 v2=. (2{n.) \
 (x. v0 y.) u. pown (x. v1 y.) (x. v2 y.)
)



Sun, 18 Oct 1998 03:00:00 GMT  
 m.



Martin Neitzel writes on Wednesday, May 1 (concerning m.):

Quote:
> It's part of an incompatible but worthwhile change from Release 2.
> The following example appears in the Rel.2 Dictionary under
> Explicit Definition ":" :  ...
> In J Rel 3, the roles of x. and y. have now changed.
> The very same place in the Dictionary now reads:  ...
> Obviously, you also gain the benefit that the new referents follow
> exactly the use of the conventional u/v/n/m/x/y names in the Dictionary.  
> Mind you, it can break old code silently.

These statements are incorrect.  The changes are compatible, and
existing code would work exactly the same as before.

In an operator (adverb or conjunction) containing references only
to x. and/or y. and none to m. n. u. v., x. and y. refer to the
operator arguments, as before.  New to J3.01, an operator may
refer to u. and/or v. (or to m. and/or n. if nouns), whence what
is being defined is the derived verb, wherein the verb argument(s)
are known as x. and/or y. .



Mon, 19 Oct 1998 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 
 

 
Powered by phpBB® Forum Software