Open cabelshrestha opened 7 years ago
more good stuff: this dies too:
public proc void guard(chan<boolean>.read[] up,
chan<boolean>.read[] down) [yield=true] {
int seated = 0;
boolean any;
while (true) {
alt {
any = down[0].read(): {
seated++;
}
}
}
}
matt
@mattunlv I'm assigning this to you for now. Are we decided on adding array.read to the grammar? If we are and once you are done, you can pass this on to me.
I have added this but can't test it cause of the issue I just opened a case about.
Matt
Dr. Pedersen comment:
So I was thinking about this:
chan
chans.read <---- that is currently illegal.
However, that is just a type checking trick
chans is of type Array(Chan
so I just need to fiddle around with building a new type but you STILL need to pass in the same cause
chans and chans.read and chans.write for YOU is the same as channels in the runtime are not by end but by the entire channel.
;-) that makes that easier
Matt
consider:
what do I do if I now wanna pass all the reading ends of up to a procedure that takes in an array of reading ends?
f(up, down)
is not right cause that is passing entire channels….so what about
f(up.read, down.read)
but that is the reading end of an array ….. that makes no sense either …
I am thinking that we should allow array.read to be an array of read ends …
matt