www.digitalmars.com         C & C++   DMDScript  

D - A few problems

When a class has functions with the same name as static functions in the
class, there are problems when trying to call them. I think it should only
match with the static ones if it's the only way it'll work. If you need to
specifically call the static one, use Class.staticfunc(foo) instead of
obj.staticfunc(foo).


If there are overloaded functions like:
void foo(char x);
void foo(int x);
and you want to call it with a literal like foo(2), I think it should match
with integer types first. The order of the integer types could be set too;
like if foo also took a byte, and since 2 doesn't overflow a byte, it'd call
that one. foo('a') would match with the char one even if one accepts a byte.


Lets say I have this template:
template Foo(T)
{
 int bar()
 {
  return 3;
 }

 class Baz
 {
  int bar()
  {
   return Foo.bar();  /* here */
  }
 }
}
it tells me: template 'Foo(T)' is not a variable. How else could I access
it? If there's no current way, perhaps my example should be allowed: the
template name can be accessed like a scope from within the template.

And a final idea, I think allowing namespaces might be good:
namespace asdf {}
so, for example, you could group a few class functions in a namespace:
class Qwerty
{
 namespace key
 {
  void press() {}
  void release() {}
  void map() {}
 }

 namespace keyboard
 {
  void map() {}
 }
}
instead of pressKey() releaseKey() etc.
Oct 13 2003