RE: Why UDT's aren't used.
>From: Kat <gertie at visionsix.com>
> > >Now who wants to write code to actually items to the phone book?
> > >Better yet, Who would dare to use this with type checking enabled?
> >
> > Certainly not me... I hate to think how much overhead is involved,
> > especially if something horrific is done like import this phone book
>from a
> > file... <shudders>
> >
> > I wish something could be done about structuring types. The hardest part
>of your
> > type code (and same for any structured type) is the PhoneBook item....
>It would
> > be nice if there was a way to reference elements of a structured type by
>name.
> > The only way to do this at the moment is to define constants, and use
> > var[ELEM_NAME]. There are problems with type-checking on large
>structured types,
> > because like with arrays at the moment, we have to check every sequence
>every
> > time something changes.
> >
> > Something that would be nice:
> > type phoneBookItem( structured sequence x)
> > ...some form of special declaration giving name and type of each
> > element to be in x...
> > end type
> >
> > The two main problems with this:
> > 1. Assigning a literal to a structured sequence will be very tricky.
> > 2. It's likely to be too radical for Rob to approve.
>
>Thinking radically.......
>
>add the var as a dynamic include pointer. Or a string execution item.
>Fetching from it or saving to it is a function call. It runs code only on
>itself, it
>returns things such as it's value or error code. It could call other code
>that
>you can write to perform actions when some var is changed. As for returning
>*native* types, point to predefined types in shared memory.
>
>But then, RobC sees no use for string execution or for dynamic includes.
>Drat it. Vote time again?
>Kat
<blink> <blink>
Um... I'm sorry, I have no idea what you are talking about.
Never mind implementation for now.... What we would LIKE in a structured
type:
*Ability to refer to a member of the type by name
*Ability to only need to type check variables that have changed
*Not losing the ability to easily cast between generic sequences and
structured types.
*Not losing the ability to easily cast between structured types and generic
sequences.
*Not losing the ability to assign literals to the variable to create a new
instance of that type.
*Ability to use these structured types inside arrays (and use the "of"
mechanism to make it efficient :o) )
*Ability to add new members to the structured type without breaking existing
code (or providing *very* easily followed error messages in places that this
is not possible, like assigning a literal to the entire sequence.
I think that's about it for now. :o)
MrTrick
|
Not Categorized, Please Help
|
|