Using MIME to send the standard APL Characters

Dick Bowman

Jim Boyd has documented [Boy95] some trial use of MIME (Multi-purpose Internet Mail Extensions) to send and receive APL code as part of Internet mail and in Usenet postings.

Jim's articles describe the principle, but do not include the code. The purpose of this document is to show just how simple and straightforward it is. The code examples are in Dyalog APL/W 7.1, and use namespaces to keep utility code where it belongs rather than obscure the application.

Function listings have been turned into GIFs using Steve Halasz' APL2GIF workspace.

The global variable MimeDir contains the path for mpack and munpack; there are four functions:

subject MimeEncode filenames

Creates a Mime-encoded file from another file (for example, a workspace). A limitation is that the subject is limited to a single word (this is problem with mpack which I have not found a way around yet).

MimeDecode filename

Unpacks a MIME-encoded file and puts the contents into the workspace

file MimeFn foo

Make a MIME-encoded file from a function

MimeGetFn file

Retrieve function from a MIME-encoded file

A problem experienced and not yet overcome with munpack is that it always puts its output file into the Dyalog working directory (even though there is a command line switch to specify the required directory - it is not currently clear to me whether this is a MIME problem or an obscure Dyalog problem).

All of these functions may be found in the Dyalog APL workspace MIME-related utilities. When I tried downloading the file I found that it was not an exact replica of the original (some blank lines had crept in); but it definitely decoded itself into a usable workspace. Of course - the right thing to do is to put workspaces onto an ftp site, but this may not always be feasible and encoding with MIME may help widen the transmittability of code. I am indebted to Jim for setting me off on this path. There should be an article about using MIME for email and Usenet postings in a forthcoming issue of APL Quote Quad

MIME encoding/decoding software is available by ftp from many sites A GUI interface for your encoding and decoding is also available with the XFERPRO shareware utility available from many ftp sites.

References

[Boy95] APL on the Internet: Using MIME to send the standard APL Characters; Jim Boyd; Presently unpublished

Code Listings

This version of the code is offered into the public domain; it may be copied or modified in any way. The only restriction on distribution is that you must acknowledge Dogon Research as the originator. All trademarks are acknowledged.

MimeEncode

MimeDecode

MimeFn

MimeGetFn


Back to the J\APL Contents Page


Copyright Dick Bowman 1995-2013; latest update 13 March 2013 (repaired links)