discuss-gnustep
[Top][All Lists]
Advanced

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

Re: ObjC additions (Was: Re: PROPOSAL: Objective-C++)


From: Björn Gohla
Subject: Re: ObjC additions (Was: Re: PROPOSAL: Objective-C++)
Date: Tue, 20 Nov 2001 16:22:38 +0100

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tuesday 20 November 2001 09:43, Bjoern Giesler wrote:

> adding my .02 Euro...
btw, is gnustep euro-ready 8-0 ?

> Am Dienstag, 20. November 2001 01:33 schrieb Björn Gohla:
> > 5. how about operators?
>
> Please, no. IMHO, you don't gain much with this, but it makes debugging a
> nightmare. I'm in the process of debugging a program which makes use of
> operator overloading in C++. I don't want operators. No. :-/
i did not write overloding ;) , they could be defined simply as per class 
aliases for messages, so you can write 

[a + b]

instead of

[a stringByAppendingString: b]

that would make debugging no more difficult than using verbose messages.

to keep their impact limited they could be made uninheritable, so to pass on 
an operator you would copy the operator-to-message mapping explicitly, this 
would reflect the view that an operator is specific to only one class. doing 
it this way could discourage the definition of superfluous and ill-defined 
operators.

> > 6. a mechanism to transparently access c types as objects (very handy
> > if you want to store them in a container)
>
> Hmm. How would this look?

as suggested in connection with abbreviated prop lists

int a = 1;
NSMutableArray foo;
<....>
[foo addObject: @a];
[foo addObject: @2];

the same way it is done with string literals there would be classes for c 
types, say GSCInt in the example, that would differ from NSValue classes in 
that they would only store references. so this does what one expects

int a = 0;
id b;
address@hidden increment];
b = @a;
printf("%i",a);
printf("%i",[b rawValue]);

prints 1 twice. perhaps provisions in connections with the retain count have 
to be made for the case when a goes out of scope while @a is stored in a 
global context.

just a thought anyway 8-)

- -- 
- --------------------
"god not only rolls the dice, he cheats too"
pub  1024D/834F4976 2001-01-07 Björn Gohla (Wissenschaftler, Weltbürger) 
<address@hidden>
     Key fingerprint = 9FF4 FEDA CCDF DA0E 14D5  8129 6C14 3C39 834F 4976
sub  1024g/29571FE2 2001-01-07
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7+nVEbBQ8OYNPSXYRAmOCAKCCPE3zo0eqxBUlaGTzflirO5xaEACeMi8g
Yx+q15qFDnkXCxA2gl/J+QI=
=CMM9
-----END PGP SIGNATURE-----



reply via email to

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