comp.lang.c
[Top] [All Lists]

Re: ?: as an lvalue

Subject: Re: ?: as an lvalue
From: Richard
Date: Mon, 31 Mar 2008 21:44:39 +0200
Newsgroups: comp.lang.c

Andrey Tarasevich <andreytarasevich@xxxxxxxxxxx> writes:

> Richard wrote:
>>> Richard wrote:
>>>>> ...
>>>>> I mean I'm OK personally with the way it works in C. I just like to
>>>>> know what is it exactly in '(c?x:y)=v' that triggers a "I don't really
>>>>> know what to say" reaction from some people.
>>>> because its not a macro? it returns a value. I dont know the legalise
>>>> words but it seems "obvious" enough to me, but again it might be because
>>>> I am tainted.
>>> Well, unary '*' operator is also not a macro. Yet it evaluates to an
>>> lvalue. Same for '[]' operator (by definition). Do you find this
>>> strange as well?
>>
>> I think you have lost the track with all due respect. His original did
>> produce an lvalue but a value.
>>
>> The "*" made it then an lvalue in the other case.
>>
>> I dont really know what we are aguing.
>
> I'm not really arguing. The way I interpreted your responses, it
> seemed that when someone said that in C++ '?:' would return an lvalue
> in this case, you essentially made it clear that you find it unnatural
> and/or illogical (again, the way I interpreted your responses). I just
> want to know what is it exactly that you find unnatural and/or
> illogical.

Firstly I wasnt aware of any C++ talk.

Secondly, I find it unnatural because it is a special operator which,
well, does not return an lvalue. Sure, I'm only arguing for "what it
is". When someone claims "this makes perfect" sense and it does not make
any sense at all in the context of the language being discussed then I
think thats a fair response.



<Prev in Thread] Current Thread [Next in Thread>
Privacy Policy