Re: Types

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

Alan replied to Jiri's argument against types:

> As John asked, are you serious?  One must check if arguments are
> legal. Would you like to have a calculation crash because way back
> there month was entered as 13/  Social security could crash that way
> because of a typo.

Using types is a debugging tool, but hardly a way to do validation. After
all, if you defined a 'month' type and passed it a 13, that would cause your
program to abort as well.

>> If you accept my previous point about a total uselessness of types,
>> and I expect the more orthodox types among you (sorry about the
>> pun), especially some youngsters, might have a real problem with
>> it, then it follows we should have just one type: objects.
>
> You are suggesting that these object declarations are like constants now,
> that their "type" just be determined internally.

Heh. Except that there are large values that constants can't take on, like
#FFFFFFFF.

But that's beside the point.

Yes, you could replace all the type declarations in your code with 'object',
and the code would run as "correctly" as it did with types - but not as
fast, since Euphoria relies on the types to optimize the code it generates.

>> And they would be automatically declared at, and their names recognized
>> as valid from the point of the first assignment. Note, we would
>> still need the sequence(), atom() and integer() functions!
>
> Jiri, Jiri, Jiri.  What's the point?  If there's only one type (objects),
> then how can you test for other types?  YOU HAVE ONE TYPE.

As Jiri pointed out, there are still sequences, atoms and integers, even if
they are only implicitly declared. Re-read what you wrote about constants:
no declarations, but still different data types.

Here's a snipped of a hypothetical example:

    s1 = "foo" & bar
    if atom( s1 ) then

The variable s1 is not explicitly declared, but you can still determine the
type, just like with constants.

> Lie down before you e-mail us.  Seriously.  Like I said, I'm listening,
> and took the time (when I should be writing a news story) to respond.
> I'm not putting you down, but some of what you said is awlfully off base

Actually, you *are* putting him down, both in your condescending tone
("Jiri, Jiri, Jiri") and comments like the ones above.

It's almost as bad as John calling Jiri's ideas "silly" or mine "insane."

Personal attacks are bad form, folks - and certainly not called for!

-- David Cuny

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

Search



Quick Links

User menu

Not signed in.

Misc Menu