Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #8747

Re: Where am I?

From markspace <-@.>
Newsgroups comp.lang.java.programmer
Subject Re: Where am I?
Date 2011-10-12 18:00 -0700
Organization A noiseless patient Spider
Message-ID <j75d85$g08$1@dont-email.me> (permalink)
References <tmac97tlq14j1tk7tfmule337v9sc6q1rh@4ax.com>

Show all headers | View raw


On 10/12/2011 5:04 PM, Roedy Green wrote:
> It would be nice for debugging to include the line number of where the
> code is when printing out the error message.  Is there a simple way to
> get it, or do you need to create a Throwable then analyse the
> stacktrace?


If project coin (the "simple" Java changes project) ever happens again, 
I would suggest line numbers and method names, at least.  Even the old C 
preprocessor stile macros like __LINE__ would be ok.  Just have the 
compiler interpret that for the line number of the source file.

__LINE__
__METHOD__
__CLASS__
__PARAMS__

__CLASS__ for the class name (less urgent due to Clazz.class.getName(), 
but handy for code templates and such), and __PARAMS__ for an anonymous 
array of the parameters of a method or constructor.

I guess you could add __LOCAL__ and __FIELDS__ for an array of in-scope 
local variables and fields respectively.  It might be desirable to also 
allow access to the names of parameters, local variables and fields too.

Hmm, this got complicated fast. :-)

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Find similar


Thread

Where am I? Roedy Green <see_website@mindprod.com.invalid> - 2011-10-12 17:04 -0700
  Re: Where am I? Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2011-10-12 17:22 -0700
    Re: Where am I? bugbear <bugbear@trim_papermule.co.uk_trim> - 2011-10-13 09:36 +0100
      Re: Where am I? Arne Vajhøj <arne@vajhoej.dk> - 2011-10-13 17:00 -0400
  Re: Where am I? Stanimir Stamenkov <s7an10@netscape.net> - 2011-10-13 03:23 +0300
    Re: Where am I? Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-10-13 07:16 -0300
      Re: Where am I? Arne Vajhøj <arne@vajhoej.dk> - 2011-10-13 22:51 -0400
        Re: Where am I? Patricia Shanahan <pats@acm.org> - 2011-10-14 04:27 +0100
          Re: Where am I? Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-10-14 07:26 -0300
            Re: Where am I? Arne Vajhøj <arne@vajhoej.dk> - 2011-10-14 18:17 -0400
    Re: Where am I? Roedy Green <see_website@mindprod.com.invalid> - 2011-10-13 10:51 -0700
  Re: Where am I? Ian Shef <invalid@avoiding.spam> - 2011-10-13 00:39 +0000
  Re: Where am I? markspace <-@.> - 2011-10-12 18:00 -0700

csiph-web