Hi,
Is it possible to make an abstract actor with parameter?
Like (in pseudocode):
abstract MyActor(Str string):Actor {
...
}
?
Thanks a lot, Xan.
If I understand you correctly your code would look something like this:
abstract const class MyActor : Actor { new make(ActorPool pool, Str param) : super(pool) { this.param = param } }
This:
using concurrent
abstract const class MyActor : Actor {
new make(ActorPool pool, Str param) : super(pool) { this.param = param }
if I name it: hola.fan gives me:
fan hola.fan /home/xan/proves/temporal/hola.fan(7,10): Unknown slot hola_0::MyActor.param ERROR: cannot compile script
hola_0::MyActor.param
What's wrongs.
Ah!, yes, you understood correctly.
Xan.
Try this Xan:
using concurrent abstract const class MyActor : Actor { const Str param new make(ActorPool pool, Str param) : super(pool) { this.param = param } }
Yes, it works. Thanks.
Login or Signup to reply.
Xan Thu 6 Oct 2011
Hi,
Is it possible to make an abstract actor with parameter?
Like (in pseudocode):
abstract MyActor(Str string):Actor {
...
}
?
Thanks a lot, Xan.
brian Thu 6 Oct 2011
If I understand you correctly your code would look something like this:
Xan Thu 6 Oct 2011
This:
using concurrent
abstract const class MyActor : Actor {
}
if I name it: hola.fan gives me:
fan hola.fan /home/xan/proves/temporal/hola.fan(7,10): Unknown slot
hola_0::MyActor.param
ERROR: cannot compile scriptWhat's wrongs.
Ah!, yes, you understood correctly.
Xan.
DanielFath Thu 6 Oct 2011
Try this Xan:
Xan Fri 7 Oct 2011
Yes, it works. Thanks.