>  what it is that I am supposed to do?

Write an invertible J verb which consumes a literal vector and produces the 
ASCII85 encoding of that vector, either as a newline-delimited literal vector 
or as a literal table.  As concisely as possible.

The focus is on the "interesting" parts of the conversion.  You may choose to 
ignore the various decorations ('<~','~>') shorthands ('!!!!!'->'z', '     
'->'y'), etc.  

The verbs in convert/misc/ascii85 are for real-life applications and may not 
ignore such details:

           1!:11]216 164 ;S:0 [EMAIL PROTECTED]'convert/misc/ascii85'
        NB. The encoding does not begin with <~, though sometimes 
        NB. this is allowed. However PDF files do not accept this prefix.
        NB. Decoding does support the prefix.

Therefore, the domains and ranges of the various verbs aren't neccesarily 
mutually compatible.  You must keep this in mind when doing comparisons.  

Having said that, there was a bug in  ascii85b  .  I didn't consider that byte 
order is relevant for integer conversion as well as padding.  Given that, we'd 
have to write something like:

           NB.  0 means big endian (standard byte order), 
           NB.  1 means little endian (reverse byte order)
           ENDIAN   =:  2 | 16b_e0 + a. i. 0 { 3!:1 ''

           ascii85c =:  a. {~ 33 + (5#85) #: _2: 3!:4 |.^:ENDIAN

Which clearly isn't an improvement over the original  ascii85  .
           
-Dan
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to