Re: assigning sequences to atoms

new topic     » goto parent     » topic index » view thread      » older message » newer message
DerekParnell said...

No, I don't think it is correct behavior. I thought that when "without type_check" is in force, then all data types are treated as if they are "objects" and any type checking that is required must be done manually using the integer(), atom(), sequence() functions.

[/quote]

Not exactly. Integers and sequences still get a certain level of type checking:

manual said...

http://openeuphoria.org/docs/eu400_0014.html#type_check

Even when you turn off type checking, Euphoria reserves the right to make checks at strategic places, since this can actually allow it to run your program faster in many cases. So you may still get a type check failure even when you have turned off type checking.

I don't believe that atoms ever do any type checking when without type_check is in effect. Basically, in some places, ensuring that data declared as sequences or integers actually matches the declaration allows faster execution and avoids machine crashes. Whenever an atom is used, the interpreter needs to check to see if it is dealing with a double or an integer, since they have to be used in very different ways. The biggest effect is on user defined types, whose type checks can make a large difference in performance.

Matt

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

Search



Quick Links

User menu

Not signed in.

Misc Menu