CVS difference for ai12s/ai12-0197-4.txt

Differences between 1.2 and version 1.3
Log of other versions for file ai12s/ai12-0197-4.txt

--- ai12s/ai12-0197-4.txt	2017/10/12 00:42:19	1.2
+++ ai12s/ai12-0197-4.txt	2017/10/12 04:36:53	1.3
@@ -1912,3 +1912,59 @@
 branch but not the others).
 
 ****************************************************************
+
+From: Brad Moore
+Sent: Wednesday, October 11, 2017  11:02 PM
+
+> One can imagine various rules and/or checks to deal with this, but 
+> there doesn't seem to be any at all.
+
+I'll have to add some more wording then, but the intent was that each unique
+subtype would have its own unique channel. So in your example, the Consume
+would block and not return since there are no generators generating values
+for that channel. You have a writer for the S10 channel, and a reader for the
+S20 channel. These coroutines will never complete, as written.
+
+A simple implementation would be to in fact instantiate and declare a
+synchronized queue instance for each subtype mentioned in the do statement,
+although it wouldn't need to be implemented as a queue.
+
+It could just be a synchronized object, or something more lightweight if
+possible. The subtype acts as a key to identify which channel is being used.
+
+****************************************************************
+
+From: Randy Brukardt
+Sent: Wednesday, October 11, 2017  11:17 PM
+
+> I'll have to add some more wording then, but the intent was that each 
+> unique subtype would have its own unique channel.
+
+That makes sense for *types*, but it doesn't make a ton of sense for subtypes,
+as you might need a specific or constrained subtype for Yield (to get the
+bounds/discriminants/tag right) and a more general type for 'Consume. Note
+that we started with such a rule (using static matching) for return statements
+and the declared return type, and ended up relaxing it more and more because
+people were tripping over issues. And Yield is very similar to a return
+statement.
+
+I'd suggest a runtime subtype check on 'Consume, and separate channels for
+different types (with some exception allowing 'Consume to be class-wide
+covering S if S'Yield is specific tagged). Or something like that.
+
+****************************************************************
+
+From: Randy Brukardt
+Sent: Wednesday, October 11, 2017  11:17 PM
+
+...
+> A simple implementation would be to in fact instantiate and declare a 
+> synchronized queue instance for each subtype mentioned in the do 
+> statement, although it wouldn't need to be implemented as a queue.
+
+That wouldn't work for the example I gave, as S10 and S20 have the same type.
+The instances would be illegal homographs. Another reason to treat subtypes
+differently than types here (your idea makes perfect sense if the type
+determines the channels).
+
+****************************************************************

Questions? Ask the ACAA Technical Agent