#1373 How to get this pod?

Akcelisto Thu 6 Jan 2011

I try:

This#.pod

but this always return sys::.

katox Thu 6 Jan 2011

p := Pod.of(this)

should do the trick.

andy Thu 6 Jan 2011

Can also do typeof.pod

Akcelisto Thu 6 Jan 2011

How to get this pod in static context?

brian Thu 6 Jan 2011

Typical trick is to just do something like this:

class Foo
{
   static Pod x() { Foo#.pod }
}

There is currently no such thing as a "containing class" type literal (although it has been discussed).

go4 Sun 9 Jan 2011

If rename the class, we need edit all reference in static context.

Maybe This#.pod is a good idea.

vkuzkokov Thu 13 Jan 2011

-1 to This#.pod returning current pod

First of all, it doesn't help while renaming because you still have to rename references in other classes.

How can it work, anyway:

  1. This# yields different instances in different contexts.
  2. This#.pod yields different values depending on context.
  3. Some even creepier solutions?

Akcelisto Thu 13 Jan 2011

How about this:: as this pod literal?

Login or Signup to reply.