On Thu, Jun 18, 2009 at 5:16 AM, Matthew Brand<[email protected]> wrote:
> e.g. if we could write:
>  nbytes =. exactsize_jmf_ 10 10;JFL

I have not had much occasion to use jmf recently, but
does this do the right thing for you?

require'jmf'
exactsize_jmf_=:3 :0
  'shape type'=. y
  sz1=. JSIZES {~ JTYPES i. type
  HS + (SZI * #shape) + sz1 * */shape
)

(Used to be J would allocate an extra byte on
the end of character and boolean arrays, I do not
know if it still does this and I have not attempted
to deal with that kind of complexity.)

-- 
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to