RE:Printing values in CINT and some thou

From: Masaharu Goto (MXJ02154@niftyserve.or.jp)
Date: Thu Jun 25 1998 - 14:50:00 MEST


Damir,

> When a newbie ROOT user wants to see how ROOT works, he does things like
> :
> 
> root [0] TText * t="fgftrjhjh"
> root [1] t
> (class TText*)0x1407b98c0
> root [2] TString * t1="fgftrjhjh"
> root [3] t1
> (class TString*)0x1407b98c0
> 
> Usually, people expect a little bit more info., for example the content
> of a string. If they do
> 
> root [17] TString j="bbbbbvbbbb"
> root [18] j
> (class TString)5376838504
> 
> There is no way except j.Data() to print the content. that's very
> un-intuitive. Should we think more about intuitiveness ?
> Is there any general method (object.Info() for example) that could be
> called each time the user specifies just the name of the object ?.
> I think it's important for these new users to feel comfortable very
> quickly, if they know C/C++, and if we don't want them to be discouraged
> and feel like "this is clearly not yet a finished product. Should we use
> it ?"
> (unfortunately, I heard already that kind of remarks). We know that ROOT
> has still some road ahead but this kind of remarks leaves me a little
> bit uncomfortable, even when I know and plea for the power of ROOT.
 
I made a change so that you can customize behavior at interactive evaluation.
You can define yourown  G__ateval() function as follows

   #include <iostream>
   int G__ateval(TString& x) {
     cout << j.Data() << endl;
     return(0);
   }
   #include <string>
   template<class T> int G__ateval(T& x) {
     cout << x << endl;
     return(1);
   }

Loading above file, G__ateval([anytype]) will be evaluated when expression is
tested from interactive interface.

This change will be included in cint5.13.62 or later.


> On a side note, when someone doesn't specify the type of a variable, for
> example
> 
> root [30] a="gfgfg"
> Warning: Undeclared data member a FILE:/tmp/ebaaaCfba LINE:1
> (char* 0x140830640)"gfgfg"
> *** Interpreter error recovered ***

This was a bug. I fixed this. If you see this message, 'a' should not be
defined. 

Masaharu Goto



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