Re: Minor evaluation issue

From: Victor Perevoztchikov (perev@bnl.gov)
Date: Sat Oct 09 1999 - 15:51:58 MEST


  Dear Masaharu,

>    x = (int i=1999);   // syntax error

yes, you are right, but as usual C++ is very eclectic.
See:
     if (int i=1999)   printf("Legal in C++ & CINT\n");   

But it is only remark. I do not ask to fix anything.

Victor

Masaharu Goto wrote:
> 
> Dear Victor,
> 
> Thank you for your comment.
> 
> 'int i=1999' is a declaration. It does not have value to return.
> On the other hand 'i=1999' is an expression which has value. To make
> things clear, consider following expressions.
> 
>    int x, j;
>    x = (int i=1999);   // syntax error
>    x = (j = 1999);     // fine
> 
> In this sense, cint's behavior is consistent with C++ language.
> 
> I think keeping current implementation is a better solution. If
> we force an output for 'int i=1999' it may create inconsistency
> regarding C++ language processing.
> 
> Thank you
> Masaharu Goto
> 
> >Dear Masaharu,
> >as I understand George meant the following:
> >
> >root.exe [0] int i = 1999     // no print here
> >root.exe [1] i = 1999         // but we have here
> >(int)1999
> >
> >Of course it is not very important. If to fix it needs less 10 minutes,
> >it would be good to do, if more no problem to leave it as it is.
> >
> >Victor

-- 
Victor M. Perevoztchikov   perev@bnl.gov  perev@vxcern.cern.ch       
Brookhaven National Laboratory MS 510A PO Box 5000 Upton NY 11973-5000
tel office : 516-344-7894; fax 516-344-4206; home 516-345-2690



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:40 MET