Deprecated. See the one on google code instead
o←)
) itself. This makes it possible for custom eventual references to immediately intervene in the message sending process (without having to install a custom actor mirror that overrides send). For 'local'/'near' references, receive simply schedules the message in the actor's own message queue.[1, 2, 3].map: .+(1).from(self) ⇒ [2,3,4]
a) o.m == o.) if m is bound to a method (if it is bound to a field, the field's value is still returned) b) m == ) if m is bound to a lexically visible method c) first-class methods are still supported, but require explicit syntax: o.&m will grab the method as a first-class closure. If m is bound to a field instead, o.&m will return an “accessor” closure which is a nullary closure yielding the field's value upon application. Method selection also works lexically: &m yields an accessor or closure for a lexically visible field or method. d) assignment is now treated as message passing, with x := 5 being equal to lexically invoking a method named “x:=” and o.x := 5 being equal to sending o the message “x:=”.
The UAP change is unfortunately not entirely backward-compatible with existing AmbientTalk code. When you upgrade to this release, you'll have to check the following: a) where you used to write 'o.m' to select a method as a first-class closure value, you should now write 'o.&m' because 'o.m' is now treated as invoking the method (i.e. o.)) b) where you used to write 'm' to select a lexically visible method to grab a method as a first-class closure value, you should now write '&m' because 'm' is interpreted as applying the method (i.e. ))
at.support.util.at
file to the system library. This file defines a number of utility functions. More information can be found in the file itself.isolatelambda:
to init.at, which allows the creation of 'pass-by-copy' closures.defstripe
keyword becomes deftype
stripesOf:
meta-method becomes tagsOf:
object:stripedWith:
method becomes object:taggedAs:
is:stripedWith:
method becomes is:taggedAs:
While this change is not backwards-compatible with current AT code (you really need to find/replace all occurences of these language constructs), we feel it is best to make this name change as soon as possible, rather than carrying an ill-chosen name for the rest of AT/2's life.
Bugfixes:
System library additions:
Implementation changes:
Bugfixes:
The futures language module now also exports two stripes, 'FutureMessage' and 'OneWayMessage'. When the 'FutureMessage' is attached to a message send, the message will always return a future (if the futures language module is activated). If 'OneWayMessage' is attached to a message send, the message will use the default behaviour (i.e. normally return 'nil') even if the futures are enabled. Hence, you have two options to work with futures from now on: you can evaluate 'enableFutures(true)' to make ← return futures by default, and use o←)@OneWayMessage to create pure asynchronous messages without futures, or you can evaluate 'enableFutures(false) to make ← behave normally (i.e. return nil) and then use o←)@FutureMessage to explicitly require the creation of futures.
actor.install: now takes an arbitrary 'protocol' object and installs that object as the mirror of the actor. Also, its return value is no longer an object you can use to 'unmix' the protocol. Rather, it now returns the old installed protocol. If you still want to mimick the old behaviour, you can do so with code like:
def mixin(protocolCode) { def oldActor := actor.install: (extend: actor with: protocolCode); object: { def uninstall() { // restore the previously active protocol actor.install: oldActor } } }
def trait := object: { def foo() { self.bar() + 3 }; def bar() { 5 }; def baz := 3; }; def obj := object: { import trait alias bar := tralala exclude baz; def bar() { 1 }; } obj.bar() => 1 obj.foo() => 4 obj.baz => error obj.tralala() => 5
Example:
import /.at.lang.futures; enableFutures(); // changes the MOP of the current actor def id(x) { x } when: self<-id(42) becomes: { |val| system.println(val == 42) }
It might be that we later decide to invoke 'enableFutures()' automatically when you load the futures module.
path1:path2:path3:… to name1=path1:name2=path2:name3=path3:… The names given in the path will be the names of slots defined in the lobby at startup time. For example, if you specify:
iat -o foo=/Users/me/test:bar=/usr/local/lib
Then in AmbientTalk: lobby.foo is bound to the namespace “/Users/me/test” and lobby.bar is bound to the namespace “/usr/local/lib”
$AT_OBJECTPATH:at=$AT_HOME/at
In other words: it uses the value of $AT_OBJECTPATH
if that variable exists (cfr. Java's $CLASSPATH
) and always includes the 'native' library which will be known under the name at
. You will see that in the new build, the native library is shipped in the at
subdirectory.
It is now allowed to shadow names in the object path (a warning is printed on the console to make you aware of the shadowing). For example, if your $AT_OBJECTPATH
equals foo=/usr/lib/ambienttalk
and you start iat
using:
iat -o foo=/test:$AT_OBJECTPATH
then lobby.foo
will be bound to /test
-i
), iat will try to load $AT_HOME/at/init/init.at or fail if it cannot find this file.-DAT_HOME="${project_loc:AT2 Library}/edu/vub"
This passes to the JVM the value of the AT_HOME
property. It is set to the location of the edu/vub subdirectory of the AT2 Library project, which contains the native AT library. Note that if you named that project differently, you need to adapt the string “AT2 Library” to match your project name.