Newsgroups: comp.lang.apl
Path: watmath!watserv2.uwaterloo.ca!torn!utcsri!rpi!usenet.coe.montana.edu!saimiri.primate.wisc.edu!caen!spool.mu.edu!umn.edu!csus.edu!sfsuvax1.sfsu.edu!emclean
From: emclean@sfsuvax1.sfsu.edu (Emmett McLean)
Subject: Re: Enhancing J file capabilities 
Message-ID: <1992Dec16.231241.28185@csus.edu>
Sender: news@csus.edu
Organization: San Francisco State University
References: <1992Dec13.070025.2011@csus.edu>
Distribution: NA
Date: Wed, 16 Dec 1992 23:12:41 GMT
Lines: 61

I received the following message addressing my post on J
file capabilities.  Since the message was posted through
an intermediary, it was suggested that I could respond 
either via email or post.  Since I wouldn't want to
take too much of Mike Porter's time by having him
polish code on my part, I thought I'd post and hope
that other users would respond.  (The verbs were 
described but not included in the message.) 

Certainly the verbs described provide exactly the
capability I would find useful.

BTW, I understand Mike can browse comp.lang.apl but
at this point can not post.

Cheers, and thanks Mike,
Emmett 

>
>To: emclean@sfsuvax1.sfsu.edu
>Newsgroups: comp.lang.apl
>
>I have just finished some J verbs to provide access to files by key
>value. These might be what you're looking for. Usage is as follows.
>
>Create <'filename'         Creates a file and initializes its directory.
>(key;value)Put <'filename' Stores value in filename by key, any noun.
>key Get <'filename'        Returns value stored in filename under key.
>Dir <'filename'            Returns a directory showing the file's keys and
>                           where they are located in filename.
>
>                           There will be a few other verbs, e.g. Find
>                           and Squeeze.
>
>These verbs take care of growing replaces. If a Put is of a new key, the
>value is padded and appended to the end of the file. If the Put is of an
>existing key, it goes back in the existing slot, if it fits. If it doesn't
>fit, the value is padded and appended.
>
>The representation of J objects in a file uses 5!:5. This means that keys
>can be more than the usual character strings. You can quite happily have
>i.4 10 as a key. Precision of representation depends entirely on 5!:5.
>Values are recreated with ". .
>
>For your particular example, you could:
>
>Create f=.<'NFL'
>Team=. whatever...
>('Miami';Team)Put f
>
>Then later,
>
>Team =. 'Miami' Get f
>Team =. Team plus some new information
>('Miami';Team)Put f
>
>This is all a little fragile today, but if it's of interest, I'd be happy
>to improve it and make it available.
>
>Mike Powell
>
