November 28, 2001
"Sean L. Palmer" <spalmer@iname.com> wrote in message news:9tael0$1dbn$1@digitaldaemon.com...
> Seems that the way Walter has set up the semantic processing separate from parsing, you could achieve the same affect with a constant global bool and an if statement or a version statement.  For each project make some kind
of
> big "version.d" or "globals.d" file.  Seems version can take any constant expression as argument.

The version statement needs a little more work in the specification department.


> It also appears that module-level functions are not possible... do all functions really have to be class members ala Java?

Module level functions are possible. No need to create dummy classes for them ala Java.


> In addition, the declaration entry in the D Syntax Grammar seems to be broken... surely some way must be specified to declare variables or class/struct members.  Has anyone given this syntax a thorough going-over?

You're right, it needs a thorough going-over.


> I'm pretty sure it's not possible to have anything at all at global scope. Is this good?  Should import be required, or could an IDE group files together that have implicit access to each other?

You can have stuff at module scope, but not at a scope more global than that. Imports are required.


> Is it possible to use version to give two separate declarations for a function parameter list without duplicating the body of the function?

No. You can probably work around this by writing a couple wrapper functions and version them.

> Since the version statement can only contain statements (does this also count local variable declarations?) can the version statement contain,
say,
> just the function signature and not the body?  What about just one
parameter
> of a function declaration?  What exactly can a version statement do?  What can it hold in its body?  Where exactly is it legal?  To replace the preprocessor fully, it'd be necessary to allow it just about anywhere, but that'll be a nightmare to the language syntax.

The version statement can enclose declarations or statements. It can't enclose parts of statements or declarations that would be ill-formed by themselves.


> What is the proper way for compiler vendors to provide extensions to the D language, such as perhaps providing a __forceinline keyword?

__ keywords are for vendor specific extensions.

> And one final question... what is the entry point to the program?  main()?
> What are the details?

import stdio;

int main(char[][] args)
{
    printf("hello world! My arguments are:\n);
    for (uint i = 0; i < args.length; i++)
        printf("arg[%d] = '%.*s'\n", i, args[i]);
    return 0;
}


1 2
Next ›   Last »