dotgnu-general
[Top][All Lists]
Advanced

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

Re: [DotGNU]C@


From: Peter Minten
Subject: Re: [DotGNU]C@
Date: Fri, 16 Aug 2002 14:00:15 +0200

Peter Minten wrote:

> 
> FEATURE LIST:
>

Addition: C@ will support global stuff. Everything not declared in a class is
put into a special 'global' class. Every namespace has a global class (which is
public sealed). A global not declared in a namespace is put into the (guess what
:-) special 'global' namespace.

By omitting the "namespacename.global" part of a global member the compiler
searches for an global class with the specifier member. In cases of ambiguousity
the compiler first tries to resolve with the 'prefer' system and if that doesn't
work it gives an error. To resolve this use the full qualifier
("namespacename.global.globalname").

Globals can be declared public or internal, the other modifiers don't make much
sense. If modifier is omitted public is assumed. Globals are always static.
The global class is abstract so no objects of type 'global' can exist.

Examples:

//Easy main method
public static void Main() /* = global.Main() */
{
        //Do stuff
}

int foo = 5; /* = global.foo */

class Bar /* = global.Bar */
{
        /* ... */
}

I guess especially C programmers will like this feature :-). Btw: combined with
C@'s #include and #define preprocessor directives this makes it almost possible
to program like in C, to make this even better I'll put stuff like ReadLine
and WriteLine in the global class of System.

Another matter: C@ will need to have a base lib with some stuff in it that isn't
in pnetlib. There isn't a dependency from the compiler to the base lib however
so it would be possible to put C@ stuff in something else than pnetlib, I'd 
suggest
using DG-Base+Pnetlib as C@ base lib (the C@ classes would go into DG-Base).

Greetings,

Peter




reply via email to

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