I might be interpreting this wrong - but is that not the case that I'm providing here?
Martin
brianTue 9 Nov 2010
It is true that Method.func is immutable, but that does not hold true once you call bind. In this case since the bound parameter(s) is const, we could actually make the result of bind immutable too. I can take a look.
In the meantime, you should be able to use closure such:
|msg| { rcv(msg) }
brianTue 9 Nov 2010
Renamed from Methods as immutable functions to Func.bind immutability
brianTue 9 Nov 2010
Promoted to ticket #1301 and assigned to brian
brianTue 9 Nov 2010
Ticket resolved in 1.0.56
I updated the Func.bind method such that functions created by sys::Func.bind are immutable if the original function is immutable and every bound argument is immutable.
msl Tue 9 Nov 2010
Sorry if this has been brought up before - have searched around but can't find anything.
I'm trying to pass a reference to a method as a handler for an
concurrent::Actor
. Something like:However, this results in a
sys::NotImmutableErr
. Looking at docLang::Functions.immutable, I'm reading:I might be interpreting this wrong - but is that not the case that I'm providing here?
Martin
brian Tue 9 Nov 2010
It is true that
Method.func
is immutable, but that does not hold true once you callbind
. In this case since the bound parameter(s) is const, we could actually make the result of bind immutable too. I can take a look.In the meantime, you should be able to use closure such:
brian Tue 9 Nov 2010
Renamed from Methods as immutable functions to Func.bind immutability
brian Tue 9 Nov 2010
Promoted to ticket #1301 and assigned to brian
brian Tue 9 Nov 2010
Ticket resolved in 1.0.56
I updated the
Func.bind
method such that functions created bysys::Func.bind
are immutable if the original function is immutable and every bound argument is immutable.changeset