[fpc-pascal] Set format

Tom Verhoeff T.Verhoeff at tue.nl
Tue Nov 14 13:15:24 CET 2006

On Tue, Nov 14, 2006 at 11:47:37AM +0100, Jonas Maebe wrote:
> I have a quick question: are there (m)any people here who store/load  
> sets to/from files?

I do not mix sets and files, but I do mix sets and Single/Double
in a record to decompose floating point numbers.

However, I don't see a big problem in converting my unit to
accommodate a different internal set representation.  (It might
even simplify matters for me.)

> The reason is that we are considering to change the internal format  
> of sets in FPC on big endian machines. The reason is that this would  
> be necessary to allow byte-packing of sets (so that e.g. a set of  
> 0..63 would only occupy 1 byte as opposed to 4 like is currently the  
> case). An added advantage would be that this would make gdb (the  
> debugger used by Xcode) display sets correctly on PowerPC's and other  
> big endian machines.
> I'm afraid this may cause backward compatibility problems, but if not  
> too many people store sets in binary files, that fear is unfounded.

I would think that in general the advantages you describe outweigh
the disadvantages.

For purposes of converting between one representation and the other,
it might be nice to provide a means to declare "old"sets, which use the
current representation, _alongside_ the new sets, which use the improved
representation.  Then it would be fairly straightforward to write a
conversion program that reads in the old format and writes out the
new format.

Thanks for enquiring,

E-MAIL: T.Verhoeff @ TUE.NL     | Fac. of Math. & Computing Science
PHONE:  +31 40 247 41 25        | Eindhoven University of Technology
FAX:    +31 40 247 54 04        | PO Box 513, NL-5600 MB Eindhoven
http://www.win.tue.nl/~wstomv/  | The Netherlands

More information about the fpc-pascal mailing list