Re: type string

new topic     » topic index » view thread      » older message » newer message

> At 04:35 PM 15-03-1999 , you wrote:
> >Roderick Jackson <rjackson at CSIWEB.COM> wrote:
> >
> >>But it would be a pitfall to me to use a type that allowed floats as
> >>characters; the only time I would ever drop a decimal number into a string
> >>would be on accident (although I'm sure others take advantage of the
> >>flexibility all of the time.)
> >
> >Hmm, let's put that to the test. Does anyone out there *intentionally* use
> >non-integer values in their strings?

Sequences != Strings

So, your answer: no, as soon as I use non-integer values, its not a string
anymore, but I almost never have any strings.
My data-structures sometimes contain strings as well. But thats a whole
different thing, isn't it ?

The issue is simply that we can't declare a sequence to a fixed number of
dimensions with a fixed type (an 'array' thus).
We need to built complex type functions for that.

Weird though. For data, we have 2 data-types: atom and an integer
You have to agree, the integer just serves as another level of 'protection' and
is not really needed.
But for the structure of our data we only have one data-type: the sequence.
I would personally like to arrays (as flexible in a sequence, however all
elements contain a value of the same type and
dimensions are fixed)

Example:

    type char (object x)    -- should be really fast
        x = ( x >= 0 ) and ( x < 256 )
        if integer (x) then
            return x
        else
            return 0
        end if
    end type

    char my_string[10] = ' '
-- dimensions are always fixed: (only one), each element should be of type
    char, and is initialized to ' '
    -- Length is fixed in this example, but not always:

   char my_string[]
-- dimensional still fixed, length is zero at the beginning, and can
    dynamically grow and shrink. Char-type is still
enforced.

And like that, I would like to see structures.
Then we would have 3 data-container types  and 2 data-value types.
( sequence, arrays, structures ) and ( atom, integer)
And like an integer is always an atom, a structure is always a sequence just
like an array works and internally is, a sequence.

Ralf

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu