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

snmpconf Policy MIB: Other intrinsic data types



One of the consequences of doing away with struct and typedef is that 
anything that is not an integer must be encoded as a string. I think this 
is a rather impoverished state of affairs. Objects like OIDs, varbinds and 
especially 64-bit integers are better represented as intrinsic types. I see 
the following as useful intrinsic types that could exist in the language to 
support our problem domain:

int    -- 32-bit signed integers
unsigned, unsigned int  -- 32-bit unsigned integers
unsigned int64 -- 64-bit unsigned integers
string   -- A text string (see my previous post)
oid     -- An OID
varbind_list   -- A list of varbinds (I'll go further into this in a future 
post)

Of all of my proposals, this one may look the most un-like C. However, C 
allows structs to be declared, passed and returned by value, etc. My 
proposal is little more than pre-defining some struct types. Yes, I would 
like to see some syntactic sugar, like having + for string or OID 
concatenation, but that is secondary. If we are concerned that such 
operator overloading is adding too much to C, we could just as easily claim 
that we are creating a subset of C++, where overloading is permitted. These 
new types, then, would just be pre-defined classes.

- Pablo
---------------------------------------------------------------------
Pablo Halpern                                    phalpern@newview.org
http://www.halpernwightsoftware.com