but the definition of cast is to change the type.
Of the value. The important part is that it's the value that changes. It's not strange that strongly typed languages blur that distinction. Especially C, which doesn't have any type info at all in values.
did you look at the links i posted.
No, sorry, I missed those. I've looked at them now and can't find the term "type cast" there either. But you're right as far as types having an important role in both cast varieties.
people use the term type casting when they mean any kind of casting. hence "type casting" already has a generic meaning.
You keep saying that, but I personally don't have that experience and so far haven't seen any evidence of that use. Anyway, I guess I'll just have to take your word for that it is so in your circles.
Maybe "type assertion" instead? That's fairly precisely what it's about.
/ Martin Stjernholm, Roxen IS
Previous text:
2004-05-19 09:40: Subject: Re: Suggestions to manual
On Wed, May 19, 2004 at 12:15:15AM +0200, Martin Stjernholm, Roxen IS @ Pike developers forum wrote:
"type cast" is free afaics.
but the definition of cast is to change the type. so type cast may be redundand but not free. did you look at the links i posted. people use the term type casting when they mean any kind of casting. hence "type casting" already has a generic meaning.
when trying to coin a new term, we need to make sure not to use one that already has a meaning, and also be specific if possible.
typeonly cast?
"variable cast" might work.
That doesn't make sense at all to me. Sounds like an attempt to change the type stored in a variable, which isn't possible (except through inherits in some special cases).
but that's exactly what seems to happen:
mixed m; typeof(m);
(1) Result: mixed
typeof([int] m);
(2) Result: int
type of the variable is changed. of course it does not change the original variable but the input to the assignment of the result.
but that is true for any cast.
greetings, martin.
/ Brevbäraren