pspp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Long-name/short-name complexity


From: John Darrington
Subject: Re: Long-name/short-name complexity
Date: Mon, 25 Apr 2005 10:15:01 +0800
User-agent: Mutt/1.5.4i

On Sun, Apr 24, 2005 at 06:29:06PM -0700, Ben Pfaff wrote:
     Hi John.  In working on the MATCH FILES command I incidentally
     ran into the new code for handling long variable names.  It seems
     needlessly complex to me to maintain both a long name and a short
     name for each variable.  Is there a good reason to do so?  I
     don't see any evidence in the Syntax Reference Guide for SPSS
     12.0 that SPSS keeps anything similar around.
     
     I would prefer to keep a single `name' member, which would be of
     flexible length and retain the original capitalization, and then
     where necessary (e.g. for SAVE and EXPORT) devise an equivalent
     8-character name.

I entirely agree.  The short name has to exist only when writing
sysfiles/portable files.  Its scope can be limited to
the routines for doing that.  However, I think it will be necessary to
keep the mapping from long to short names in static memory somewhere
otherwise the mapping could change unexpectedly.  Consider the
following scenario:

* foo.sav contains a variable called ABCDEFGHIJ (short name ABCDEF_1)
GET /FILE='foo.sav'.

AGGREGATE /OUTFILE=* /ABCDEFGHI=MAX(ABCDEFGHIJ).

SAVE /OUTFILE='foo.sav'.
* foo.sav now contains 2 variables:
* ABCDEFGHI  (short name ABCDEF_1)
* ABCDEFGHIJ (short name ABCDEF_2)


     
     I am willing to write and test this change.  I think it should go
     into 0.4.0, unless you have some serious objections.
     
No objections from me.

You'll have to change var_to_string so that it returns the long name,
which will affect *all* the tests ......

J'


-- 
PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See http://pgp.mit.edu or any PGP keyserver for public key.


Attachment: pgpQMMYngXPmo.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]