at:tutorial:symbiosis
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
at:tutorial:symbiosis [2008/10/22 18:31] – updated tvcutsem | at:tutorial:symbiosis [2009/01/26 16:54] – comment elisag | ||
---|---|---|---|
Line 11: | Line 11: | ||
When AmbientTalk values and Java values cross language boundaries (e.g. when they are passed as arguments of or return values from a method that is invoked from the other language), these values are converted. AmbientTalk features a number of built-in conversions that maps AmbientTalk' | When AmbientTalk values and Java values cross language boundaries (e.g. when they are passed as arguments of or return values from a method that is invoked from the other language), these values are converted. AmbientTalk features a number of built-in conversions that maps AmbientTalk' | ||
- | ^ Java type and value ^ AmbientTalk value ^ | + | ^ Java value : type ^ AmbientTalk value ^ |
| null: Object | nil | | | null: Object | nil | | ||
| n: int | a number n | | | n: int | a number n | | ||
Line 19: | Line 19: | ||
| array: T[] | a table (of converted values) | | | array: T[] | a table (of converted values) | | ||
| e: Exception | an exception e | | | e: Exception | an exception e | | ||
- | | c: Class | class wrapper(c) | | + | | c: Class | class wrapper( c ) | |
| o: ATObject | o | | | o: ATObject | o | | ||
| o: Type | java wrapper(o : Type) | | | o: Type | java wrapper(o : Type) | | ||
Line 33: | Line 33: | ||
| a class wrapper( c ) | c : Class | | | a class wrapper( c ) | c : Class | | ||
| a java wrapper(obj : Type) | obj : Type | | | a java wrapper(obj : Type) | obj : Type | | ||
- | | any object o | AT wrapper (o) : Interface | + | | any object o | AT wrapper (o) : I | |
Note that non-native Java or AmbientTalk objects are represented in the other language by means of " | Note that non-native Java or AmbientTalk objects are represented in the other language by means of " | ||
+ | |||
+ | In the last conversion rule of the second table, '' | ||
===== Accessing Java from within AmbientTalk ===== | ===== Accessing Java from within AmbientTalk ===== | ||
Line 49: | Line 51: | ||
A class is represented as a normal AmbientTalk object. All '' | A class is represented as a normal AmbientTalk object. All '' | ||
+ | |||
+ | < | ||
+ | If you want to load your own Java class make sure that the .class file is in the classpath of the JVM running AmbientTalk. By default, the iat script puts the at/ directory of the AmbientTalk distribution in the classpath. | ||
+ | </ | ||
==== Creating Java objects ==== | ==== Creating Java objects ==== |
at/tutorial/symbiosis.txt · Last modified: 2013/05/17 20:25 by tvcutsem