[Top][All Lists]

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

Re: Emacs contributions, C and Lisp

From: Eli Zaretskii
Subject: Re: Emacs contributions, C and Lisp
Date: Fri, 09 Jan 2015 10:36:08 +0200

> Date: Thu, 08 Jan 2015 18:59:24 -0500
> From: Richard Stallman <address@hidden>
> Cc: address@hidden
>   > auto some_var = foo(bar);
>   > and when the compiler resolves `foo' it can choose an overload depending
>   > on complex attributes of `bar' (such as if `bar' is an instance of a
>   > class that implements certain method.) As each overload can return a
>   > different type, only a C++ compiler can know which type `some_var'
>   > finally is.
> To handle that, it is sufficient that the compiler say what type
> some_var was ultimately given.  Of course, the data must include
> the data types of all identifiers.

A single source line can reference more than one identifier that have
the same string as their name, but different semantics and types.  A
list of all the identifiers and their types is not enough to handle
that; you need to know the type of each 'foo' in its exact place.
Even in C, a single string can mean very different things in the same
program unit, due to different namespaces, like variables/functions vs
struct tags vs struct members vs labels.

Further, to support refactoring, one needs to have access to the
semantics of arguments of each function, otherwise the refactored code
will fail to compile at best and introduce subtle bugs at worst.  The
list of identifiers and data types won't be enough here as well.

> Some data that I am sure is NOT needed is the entire statement-level
> structure.

I suggested to write down requirements for what _is_ needed.  I
suspect that the full amount of syntactic and semantic information
that is needed for the features we are discussing is very close to the
AST.  After all, what other ways are known to mankind for expressing
this kind of information?

Since no one seems to be willing to bite the bullet, how about the
list of features, such as completion and refactoring, that we would
like to enable?  Would someone who feels they know enough about this
please post such a list, with a short (1-2 sentences) description of
each feature?

The reason I think such a list would be useful is that I'm not sure
Richard is aware of the kind of features we are talking about, which
makes this discussion less efficient and effective than it could be.

reply via email to

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