How can I get the FQN of a class?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

How can I get the FQN of a class?

chad
How can I get the FQN of a class?
I espessially want to get the FQN of a smalltalk class while in java given java PrimObject that represtent an instance of the smalltalk class I am interested in.
So I want some thing like
PrimObject x;
String fqn = x.cls().fqn();

Reply | Threaded
Open this post in threaded view
|

Re: How can I get the FQN of a class?

James Ladd
Currently the ability to get the Fully Qualified Name (FQN) of a
Smalltalk class is not supported.
However, during the creation of a sub-class the FQN is known so it is
rather easy to put this into
the associated class, as you describe:  'self class fqn'

When implemented ... accessing the FQN from Java will get back a
Smalltalk String, and you will
need to ask the String for its javaValue() in order to extract the FQN
as a Java String.

I will create an Issue for this in the Redline Smalltalk github page
and work on it a.s.a.p
It should only be a day or two.

On Oct 17, 10:24 am, chad <[hidden email]> wrote:
> How can I get the FQN of a class?
> I espessially want to get the FQN of a smalltalk class while in java given
> java PrimObject that represtent an instance of the smalltalk class I am
> interested in.
> So I want some thing like
> PrimObject x;
> String fqn = x.cls().fqn();
Reply | Threaded
Open this post in threaded view
|

Re: How can I get the FQN of a class?

James Ladd
I thought about this a bit more and I'm wondering, should the fully qualified name be
available in the class, or the class of a class?

Since a metaclass is the class of a class it makes sense to me that this is the
place to know the fully qualified name.

Thoughts?

Reply | Threaded
Open this post in threaded view
|

Re: How can I get the FQN of a class?

James Ladd
In reply to this post by chad
You can now get the fully qualified name of a class using the fullyQualifiedName selector.
Eg:

 String fullyQualifiedName >> st.redline.core.String



On Wednesday, 17 October 2012 10:24:51 UTC+11, chad wrote:
How can I get the FQN of a class?
I espessially want to get the FQN of a smalltalk class while in java given java PrimObject that represtent an instance of the smalltalk class I am interested in.
So I want some thing like
PrimObject x;
String fqn = x.cls().fqn();

Reply | Threaded
Open this post in threaded view
|

Re: How can I get the FQN of a class?

Jeff Heon
Thanks James. Nice work!
Reply | Threaded
Open this post in threaded view
|

Re: How can I get the FQN of a class?

James Ladd
Thanks - improved 'import:' scope coming very soon.

On Mon, Oct 22, 2012 at 6:18 AM, Jeff Heon <[hidden email]> wrote:
Thanks James. Nice work!