vlsidesign wrote, on 05/14/08 22:55:
> On May 14, 12:16 pm, vlsidesign <ford...@[EMAIL PROTECTED]
> wrote:
>> I believe in C, an assignment expression returns the value of the left
>> side of the assignment. For example, a = 2, would return 2.
>>
>> If this is true, is Skill similar? For instance, if I have the
>> following, a = nil, would it return nil ?
>
> It seems like it would return nil but for different reason than C. I
> believe it returns the value of the expression on the right side that
> happens to be what is assigned to a.
The assignment operator is converted into functional equivalent, by
working
from right to left. Most operators work left to right:
> sstatus(printinfix nil)
nil
> '(a=b=c=d=5)
(setq a
(setq b
(setq c
(setq d 5)
)
)
)
The above shows you the functional equivalent (i.e. how it is actually
implemented)
for a=b=c=d=5. So you can see precedence and left-to-right/right-to-left
handling
by looking at the output of that.
So it behaves just like C in this respect - the compiler expands =
operators right to left.
Regards,
Andrew.


|