Skip to content

"kernel.evalBuilder(..)" #111

@andrus

Description

@andrus

Currently kernel has eval(..) and evalRaw(..) methods that are used almost interchangeably without much thought where in fact there are three distinct evaluation steps spread between the two of them:

  1. Preprocess source replacing magics with Java calls (evalRaw(..))
  2. Evaluate the source (evalRaw(..))
  3. Render the result, and return it as DisplayData (eval(..))

Would be great to have more control over which step (or steps) are invoked in any given context. E.g., we are calling eval(..) and then discarding the result; or we'd call evalRaw(..) when the magics are already resolved. So let's replace both eval(..) and evalRaw(..) with a monad that allows to pick and chain stages as needed:

kernel.evalBuilder(source).resolveMagics().renderResults().eval()

Also, clean stage separation should help in adding most accurate instrumentation per tasks like #104.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions