Version 17 by komaz
on Nov 25, 2010 21:16.

compared with
Current by komaz
on Nov 25, 2010 21:46.

This line was removed.
This word was removed. This word was added.
This line was added.

Changes (2)

View Page History

h3. Brief intro to DSLs
[Fandoc|] says:


There's one problem with this code, imagine the case like this:
const class Foo
@Magic { kind = ActorLocal<||> }
Str s
const class MyActor
const Foo foo1
const Foo foo2
override Obj? receive(Obj? msg)
foo1.s = "str" //now foo2.s equals to "str" too
And I don't really know if this can be fixed correctly. In theory, we could store map {{\[Foo:FieldType\]}} in {{Actor.locals}}, but there are two obstacles:
# We won't know when to remove values from this map, probably weak keys could help
# Foo must be const - only const objects can be used as map keys

However, I don't think it is a big deal, since typically such fields can be declared in actors itself and used only from {{receive}} method, so they'll act as normal instance fields.

h3. Conclusion