These are chat archives for MetaStack-pl/MetaRx

Jan 2016
Jan 12 2016 04:57
Thank you
Jan 12 2016 05:52
Need the example of buffer.replace with Ref and case class because I get an exception on that.
Here is my example:
case class A(age: Int)
val buffer = Buffer( Ref(A(1)), Ref(A(2)) )
val ref1 = buffer(1)
buffer.replace(ref1, Ref(A(3)) )
java.lang.AssertionError: assertion failed: Cycle found
at scala.Predef$.assert(Predef.scala:165)
at pl.metastack.metarx.UniChildChannel.process(Channel.scala:589)
at pl.metastack.metarx.WriteChannel
KaTeX parse error: Unexpected character: '$' at position 7: anonfun̲$produce$ anonfun$produce$1.apply(Channel.scala:419)
  at pl.metastack.metarx.WriteChannel
at scala.collection.immutable.List.foreach(List.scala:381)
at pl.metastack.metarx.Array.foreach(Array.scala:15)
at pl.metastack.metarx.WriteChannel$class.produce(Channel.scala:419)
at pl.metastack.metarx.StateBuffer
KaTeX parse error: Unexpected character: '$' at position 4: anon̲$1.produce(Buf: anon$1.produce(Buffer.scala:222)
  at pl.metastack.metarx.reactive.propagate.Produce$class.$colon$eq(Produce.scala:5)
  at pl.metastack.metarx.StateBuffer
at pl.metastack.metarx.WriteBuffer$class.replace(Buffer.scala:656)
at pl.metastack.metarx.Buffer.replace(Buffer.scala:683)
... 43 elided
Tim Nieradzik
Jan 12 2016 12:46
I've tried out the code. It works fine here.
Your problem is related to something else.
You have a cycle in your code.
Jan 12 2016 16:37
Thank you for reply. I try that on Scala REPL and may be it is my mistake. I will try that again.