Thanks to all, this is very useful advice. I will add a map_exact
function to the jmf namespace.

Matthew.

2009/6/19 bill lam <[email protected]>:
> Or you may patch map inside jmf to provide the entire shape,
>
>   (JFL;10 10) map1_jmf_ 'tmp';'/tmp/tmp'
>   $tmp
> 10 10
>
>
> --- jmf.ijs     2009-06-11 13:36:33.000000000 +0800
> +++ jmf1.ijs    2009-06-19 09:43:35.000000000 +0800
> @@ -317,11 +317,12 @@
>  NB. =========================================================
>  NB.*map v map a file
>  NB. [type [,trailing_shape]] map name;filename [;sharename;ro]
> -map=: 3 : 0
> -0 map y
> +map1=: 3 : 0
> +0 map1 y
>  :
>  if. 0=L.x do. t=. <&> x else. t=. x end.
>  'type tshape hsize'=. 3 {. t, a:
> +tshape=. }.tshape [ lshape=. {.tshape
>
>  'trailing shape may not be zero' assert -. 0 e. tshape
>
> @@ -392,7 +393,7 @@
>   had=. allochdr 127                   NB. allocate header
>   bx=. JBOXED=type
>   hs=. (+/hsize)*asize=. JSIZES {~ JTYPES i. type
> -  lshape=. bx}.<.(ts-hs)%(*/tshape)*asize
> +NB.   lshape=. bx}.<.(ts-hs)%(*/tshape)*asize
>   d=. sfu hs+-/ufs fad,had
>   h=. d,aa,ts,type,1,(*/lshape,tshape),((-.bx)+#tshape),lshape,tshape
>   h memw had,0,(#h),JINT  NB. set header
>
> --
> regards,
> ====================================================
> GPG key 1024D/4434BAB3 2008-08-24
> gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
> ----------------------------------------------------------------------
> 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