Kulla: JShell API ready for round two review

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Mon Aug 10 14:43:59 UTC 2015



On 31/07/15 02:12, Robert Field wrote:
>> "corralled" is linked to ACTIVE_CORRALLED enum  value. The doc says "coralled or ACTIVE_FAILED".  I thought it is better if it reads ACTIVE_CORRALLED or ACTIVE_FAILED. i.e., use enum constant name for both parts of "or”.
> True, more consistent.  Will change.
I also find current naming a bit confusing; would also suggest moving 
away from CORRALLED, which can be very obscure for non-english folks.

One more high-level note on this Status enum is that it seems to try to 
fold together too much info at once; from the documentation, it seems 
like the snippet status is described by a point along the following axis:

1) ResultKind:
     SUCCESS
     FAILED

2) Compilation
     EXPLICIT
     IMPLICIT

3) State
    NON_EXISTENT
    ACTIVE
    OVERWRITTEN
    REJECTED
    DROPPED

4) Corral:
    NOT_CORRALLED
    CORRALLED

Then, we can map existing states as follows:

ACTIVE -> 1 = SUCCESS, 2 = any, 3 = ACTIVE, 4 = NOT_CORRALLED
ACTIVE_CORRALLED -> 1 = SUCCESS, 2 = any, 3 = ACTIVE, 4 = CORRALLED
ACTIVE_FAILED -> 1 = FAILED, 2 = IMPLICIT, 3 = ACTIVE, 4 = any
DROPPED: 1 = any, 2 = any, 3 = DROPPED, 4 = any
NONEXISTENT: 1 = any, 2 = any, 3 = NON_EXISTENT, 4 = any
OVERWRITTEN: 1 = any, 2 = any, 3 = OVERWRITTEN, 4 = any
REJECTED_FAILED: 1 = FAILED, 2 = IMPLICIT, 3 = REJECTED, 4 = any

Furthermore, it's not clear, from the docs, why one would care about the 
distinction between REJECTED vs. DROPPED vs. OVERWRITTEN, given their 
behavior is pretty much the same:

* they do not react to updates
* cannot be executed
* cannot be used by new snippets

Of course, now all three of those are needed, as the state is all folded 
together; but with a richer state representation, I can easily see (3) 
going down to only 3 slots (NON_EXISTENT, ACTIVE, INACTIVE)

Maurizio



More information about the kulla-dev mailing list