discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: _e_info in NSException.h


From: Sebastian Reitenbach
Subject: Re: _e_info in NSException.h
Date: Mon, 14 Jan 2008 08:35:55 +0100

Hi,

Richard Frith-Macdonald <richard@tiptree.demon.co.uk> wrote: 
> 
> On 13 Jan 2008, at 21:20, Sebastian Reitenbach wrote:
> 
> > Hi,
> >
> > after I got sope and sogo working with gnustep-make 2 and gnustep-base
> > 1.14.1, I tried to compile against gnustep-base1.15.2.
> >
> > sope compilation ended in an error:
> > Structure has no member named: _e_info
> > there is a line:
> > ASSIGN(self->_e_info, _userInfo);
> >
> > after a bit digging I figured out that it was removed not long ago  
> > from
> > NSException.h:
> >
> > http://svn.gna.org/viewcvs/gnustep?rev=25681&view=rev
> > after adding again:
> > NSDictionary *_e_info;
> >
> > sope compiled again.
> >
> > I wonder why was it removed? or is it an error to set it, in the first
> > place?
> 
> It's an error to try to set it in the first place  ... the leading  
> underscore in the name if the instance variable tells you that this  
> is a private instance variable intended for internal use only.  In  
> 1.15.2 it has been replaced by _reserved (which is used only when  
> necessary to store additional information .... user info and/or  
> stacktrace ... in an exception).
ah, thanks, understood.

> NSException has no external instance variables ... I guess if the  
> sope code wants to store extra information in an exception it should  
> create a new exception based on the values returned by the methods of  
> the original one.
>   

In sope I find this:

#if GNUSTEP_BASE_LIBRARY
/* FIXME: TODO: move someplace better (hh: NGExtensions...) */
@implementation NSException(setUserInfo)

- (id)setUserInfo:(NSDictionary *)_userInfo {
  ASSIGN(self->_e_info, _userInfo);
  return self;
}

@end /* NSException(setUserInfo) */
#endif

and then later in the file, setUserInfo is used. 
I took a quick look and found setUserInfo available in libFoundation, and 
there is no #if COCOOA, so I assume it is there available too, (I have no 
MAC to make sure). In my eyes it would make most sense to add 
setUserInfo to NSException in gnustep-base, and then remove all the #if 
GNUSTEP_BASE_LIBRARY stuff from sope, or at least replace it for now with 
sth. that checks for the GNUSTEP_BASE version.

Would that make sense, or is a too bad idea?

cheers
Sebastian





reply via email to

[Prev in Thread] Current Thread [Next in Thread]