s1s0 / toped

Cross platform, open source IC layout editor
http://www.toped.org.uk/
GNU General Public License v2.0
15 stars 8 forks source link

extending echo() for debugging reasons #103

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
To alleviate debugging and to keep debugging code more compact an extension of 
echo is requested. 
Echo (or should it be renamed to print or printf ?) should handle an arbitrary 
number
of arguments - strings or datatypes

real len = 1.41;
point vec = {1,1};
echo ("vector: ",vec, "with length", len);

Original issue reported on code.google.com by analogc...@gmx.net on 19 Jul 2011 at 8:18

GoogleCodeExporter commented 9 years ago
echo from the beginning was considered temporary - the idea is to announce it 
obsolete in the next revision...

Following the general idea to stay close to C where possible - two new 
functions are introduced:
string sprintf(string format, ... );
void printf( string format, ... );

They are principally the same as their C counterparts - and do implement the 
same %format tabs as the C functions. The latter can be seen for example here:
http://www.cplusplus.com/reference/clibrary/cstdio/printf/

Yet again - the formatting should work exactly as described in the link above 
including the flags, width,precision,length and of course the specifiers.

This leaves us a bit short with respect to some of the TELL build-in types - 
like point and box. It seems this can be covered by some simple user functions 
though.

Ideas?

Further tests feedback would be also appreciated.

Original comment by krustev....@gmail.com on 30 Jul 2011 at 7:09

GoogleCodeExporter commented 9 years ago
I'm closing this issue for the time being. It can be reopened with more ideas 
eventually.

Original comment by krustev....@gmail.com on 11 Aug 2011 at 8:38

GoogleCodeExporter commented 9 years ago

Original comment by krustev....@gmail.com on 1 Apr 2012 at 12:21