Munksgaard / session-types

MIT License
549 stars 21 forks source link

Make `unsafe_read_chan` and `unsafe_write_chan` unsafe #13

Closed Munksgaard closed 9 years ago

Munksgaard commented 9 years ago

I think this would make a lot of sense, even though they aren't publicly exposed. That way we'd also have cleaner impls:

pub fn send(self, v: A) -> Chan<E, P> {
    unsafe {
        unsafe_write_chan(&self, v);
        transmute(self)
    }
}

Do you agree?

laumann commented 9 years ago

We discussed this offline and agree that it makes sense to mark unsafe_{read,write}_chan unsafe (and change the names to {read,write}_chan) to indicate that they should not by themselves be considered safe.

EDIT: In other words, go ahead :+1:

laumann commented 9 years ago

Closing this - it's already fixed

Munksgaard commented 9 years ago

No it isn't, but I just created a pull-request.