Kulla: JShell API ready for round two review

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



On 10/08/15 15:43, Maurizio Cimadamore wrote:
> 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) 
And, by folding 4 with 1, I think only three axis are needed:

1) Last compilation result kind
     SUCCESS
     CORRALLED
     FAILED

2) Last compilation kind
     EXPLICIT
     IMPLICIT

3) Snippet state
    NON_EXISTENT
    ACTIVE
    INACTIVE

Note that the snippet state is really (3) - I believe (1) and (2) 
together are an optional extra info associated with the snippet status 
(only when the snippet is ACTIVE).

This would lead to something like this:

class Status {
     enum Kind {
        NON_EXISTENT,
        ACTIVE,
        INACTIVE
     }

     Optional<CompilationStatus> compilationStatus;
}

class CompilationStatus {
    enum Kind {
        IMPLICIT,
        EXPLICIT;
    }

    enum Result {
        SUCCESS,
        CORRRALLED,
        FAILED;
    }

    Kind kind; Result result;
}

Maurizio


More information about the kulla-dev mailing list