torsdag 16. juni 2016 17.19.58 UTC+2 skrev Øyvind Teig følgende: > > occam pi has/had mobile channels, where data pointed to by the pointer > that's implicitly sent over the channel will fall out of scope on the > sender side. I don't even think that data is converted to a const, the data > won't exist anymore. The language takes care of this. > > Sending a pointer across without such a mechanism is rather risky, isn't > it - if one doesn't introduce a "taken" return message and all parties > respect it. If not, is it avoidable to insert data state and eventual > polling? > > Øyvind > > fredag 8. april 2011 22.13.44 UTC+2 skrev Ian Lance Taylor følgende: >> >> siddarth shankar <sith.dart...@gmail.com> writes: >> >> > The reason I asked if it is discouraged is because of the absence of a >> > const-style type-constraint. >> > >> > In that case there won't be an error thrown if the code on the >> > subscriber-side modifies the data passed as a pointer(library design >> > for instance) >> >> That is true. >> >> > Could the compiler do this optimization if it knows that the data sent >> > is not modified? >> > This could help the GC a lot.. >> > Or would that lead to too much automagic-code/over-engineering? >> >> The compiler could do that in principle in some cases, but I think the >> context would be so limited that it's unlikely that this optimization >> would ever be implemented. It could only be done if all the relevant >> code were in the same package. The compiler would have to be able to >> prove that it could see all possible sends and receives on the channel >> in question. Without thinking about it too hard, I suspect that there >> would be many cases where it would seem that the optimization would >> apply but where the compiler could not quite prove that it would apply. >> >> Ian >> >>
-- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.