The factory for OOLAGValues is LV.
The factory for OOLAGValues is LV.
Used to check things that OOLAG doesn't protect against such as index out of bounds.
Used to check things that OOLAG doesn't protect against such as index out of bounds.
When we rationalized some of the try/catches so they catch less-broad catagories of exceptions, well now some things are ambiguous failures. If lazy val foo = schemas(0).schemaDocs(0) fails with index-out-of-range, is that a programmer error, or just the computation failing because there aren't any schemas, so the lazy val foo should fail, causing an OOLAG capture of the error.
In the past, OOLAG would have caught this indexing exception, converted it to an SDE, and in the case where it was a programmer mistake, it would have masked that mistake.
Now we've flipped it. Now OOLAG won't catch this, but we need a way to say explicitly, that we're assuming there are schemas, so schema(0) should work, and if it doesn't, OOLAG should catch this and abandon computing whatever attribute we were trying to compute, and put that attribute in the 'already been tried' state.
Detect circular relationships among LVs.
For diagnostics/trace/debug purposes
For diagnostics/trace/debug purposes
If multiple diagnostic messages can be created by an action, then this returns a sequence of multiple diagnostic objects.
If multiple diagnostic messages can be created by an action, then this returns a sequence of multiple diagnostic objects. If the message is a fatal runtime issue, then this might be a singleton list, or it could be a bunch of warnings followed by a fatal runtime error.
The order of the sequence is important. When the diagnostics are about a file of text, then diagnostics that are about lines earlier in the file are earlier in the list.
Currently we depend on being able to evaluate these repeatedly, and get different answers.
Currently we depend on being able to evaluate these repeatedly, and get different answers.
because it forces evaluation of all the requiredEvaluations(...) on all objects first, but that is only for the objects that have been created at the time this is called.
My parent, unless I am the root and have no parent.
My parent, unless I am the root and have no parent. In that case this aborts with a usage error. Programmer should have called isOOLAGRoot first.
Implementor of OOLAGHost constructs Diagnostic objects because it has other context (schema components) needed in order to provide a good diagnostic.
Implementor of OOLAGHost constructs Diagnostic objects because it has other context (schema components) needed in order to provide a good diagnostic.
So we have this abstract method that is implemented by things that can actually construct Diagnostic objects (Anything that ThrowsSDE)
Either we were called with a constructor arg that provides the oolagContext, or we were constructed with no args, and in that case someone must call setOOLAGContext before we access the oolagContext.
Use to make debug printing over small code regions convenient.
Use to make debug printing over small code regions convenient. Turns on your logging level of choice over a lexical region of code. Makes sure it is reset to whatever it was on the exit, even if it throws.
Call with no log level argument to turn it off (when done debugging). That way you can leave it sitting there.
An OOLAGHost, or OOLAG for short, is a collection of OOLAGValues or LVs for short.
The way these are generally used now is like this
def foo = LV('foo) {...calculation...}.value
or, if you would like a slot to show up in the debugger so you can more easily see the value of the LV then you can
Why scala needs 'real' Lisp-style macros: Well wouldn't it be nicer if I could write:
and have that be equivalent the more verbose stuff above it? But I digress...
OOLAGHosts support a feature called requiredEvaluations. This is a lazy function the arguments to which are only evaluated when the isError summary operation is invoked.
The requiredEvaluations function takes any number of arguments, they are of type Any. Suppose we have the LV named 'foo' from above. If we want to say that our particular OOLAGHost-derived class must evaluate the 'foo' LV otherwise we don't know if it has errors or not, then we write:
This goes at the top of the class definition. When isError is invoked the value of 'foo' will be computed if it has not been attempted already. This insures that the value exists for 'foo', or any errors/warnings to be determined by its calculation have been recorded.