RE: Introspection Capabilities in Java (RE: Languages and AI)

From: Ben Goertzel (ben@webmind.com)
Date: Fri Jul 20 2001 - 18:13:02 MDT


Very cool, man!! I guess this is new with 1.3. I admit I'm showing my age
here... the last time I seriously coded Java was in 1.2 ...

ben

> -----Original Message-----
> From: owner-sl4@sysopmind.com [mailto:owner-sl4@sysopmind.com]On Behalf
> Of Ben Houston
> Sent: Friday, July 20, 2001 7:10 PM
> To: sl4@sysopmind.com
> Subject: Introspection Capabilities in Java (RE: Languages and AI)
>
>
> Ben Goertel said:
> >In Java, you can't introspect to see the *runtime* state of an individual
> >object (the ephemeral values with which local variables are
> instantiated).
> >For this, we'd need a fundamentally different JVM.
>
> You can query and modify values of objects in java at runtime.
> In fact, we
> are doing it in the current project I am working on (this isn't a bluff or
> grandstanding, we actually are). We are using the following classes that
> are documented in the standard Java implementation:
>
> Java.Lang.Class
> http://java.sun.com/j2se/1.3/docs/api/java/lang/Class.html
> - can be used to get a complete list of available Classes.
> - can be used to instantiate new Classes of any type.
> - used to query a Class for available Field and Methods
>
> Java.Lang.Reflect.Method
> http://java.sun.com/j2se/1.3/docs/api/java/lang/reflect/Method.html
> - used to get info on a Method and even invoke it.
>
> Java.Lang.Reflect.Field
> http://java.sun.com/j2se/1.3/docs/api/java/lang/reflect/Field.html
> - used to get info on a Field, get its value or change it.
>
> Cheers,
> -ben houston
> http://www.exocortex.org/~ben
>
>
> -----Original Message-----
> From: owner-sl4@sysopmind.com [mailto:owner-sl4@sysopmind.com]On Behalf Of
> Ben Goertzel
> Sent: Friday, July 20, 2001 6:28 PM
> To: sl4@sysopmind.com
> Subject: RE: Languages and AI
>
>
> > But it wouldn't be that hard to write up an XML parser that can
> > modify/execute objects, methods or events using introspection -
> > introspection is supported pretty well in both C# or Java.
>
> In Java, you can't introspect to see the *runtime* state of an individual
> object (the ephemeral values with which local variables are instantiated).
> For this, we'd need a fundamentally different JVM.
>
> Maybe this will be supplied in Pizza (which adds higher-order functions to
> Java) or some other new-wave Java variant
>
> Ben



This archive was generated by hypermail 2.1.5 : Wed Jul 17 2013 - 04:00:37 MDT