[Top][All Lists]

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

Reuse of structs

From: John Darrington
Subject: Reuse of structs
Date: Sat, 24 Jan 2015 07:30:14 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

There are a number of definitions of what seem to be very similar
structs, which are used for similar purpose, viz:

In crosstabs.q:

/* A single table entry for general mode. */
struct table_entry
    struct hmap_node node;      /* Entry in hash table. */
    double freq;                /* Frequency count. */
    union value values[1];      /* Values. */

In freq.h:

/* Frequency table entry. */
struct freq
    struct hmap_node hmap_node; /* Element in hash table. */
    union value value;          /* The value. */
    double count;               /* The number of occurrences of the value. */

and in piechart.h:

struct slice
    struct string label;
    double magnitude;

I don't know what extent we can re-use the code which accesses these structs, 
but I think
it would be beneficial to keep that option open and combine these definitions 
into one common

What do you think?


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

Attachment: signature.asc
Description: Digital signature

reply via email to

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