devlaam / leucine Goto Github PK
View Code? Open in Web Editor NEWSmall x-platform actor framework
License: MIT License
Small x-platform actor framework
License: MIT License
In the code we have the following remarkable issue. This compiles:
/** Register this actor. */
private[actors] override def register(prename: String): String =
parent.map(_.adopt(prename,self)).getOrElse(super.register(prename))
whereas this does not:
private[actors] override def register(prename: String): String =
parent match
/* Children register at the parent. */
case Some(p) => p.adopt(prename,self)
/* If this is the root of the family then we register at the guard. */
case None => super.register(prename)
with the error
dotty.tools.dotc.core.RecursionOverflow: Recursion limit exceeded.
Maybe there is an illegal cyclic reference?
I have no idea why. Should those forms not be equivalent? I have seen this effect over several Scala versions now, but I was not able to isolate it.
This issue does not influence the use of the library.
In the code i make use of isInstanceOf
and asInstanceOf
:
/* Deliver the letter in the envelope. */
private[actors] final def deliverEnvelope[Sender >: Common <: Accept](envelope: Env[Sender], state: State): State =
/* Let the letter be processed */
val received = receive(envelope.letter,envelope.sender)
/* The state remains unchanged, if we work stateless, otherwise compute the new state.
* TODO: Can this also be solved compile time? In an elegant manner?
* Based on this: https://scastie.scala-lang.org/13dD1LD8Q3OUpLrn89oLqw? */
if received.isInstanceOf[Unit] then state else received.asInstanceOf[State => State](state)
This could of course also be done with a match
construction, but i'd rather have something that is tied to the type of Receive
itself. Is this possible, given that Receive
is defined like:
type Receive = State match
case Actor.State.Default.type => Unit
case Actor.State => (State => State)
Is this possible?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.