Representing the case "no result"



Robert Dodier wrote:
> On 6/8/09, Richard Fateman <fateman at cs.berkeley.edu> wrote:
>
>   
>> 1.  There is really no need for a gensym.  There could simply be an
>> array of noobjects.
>> E.g. NoObject[45], NoObject[46],  ....
>> 2. What can be done with this?
>> Well, we can also produce
>> Diagnosis[45]:  "The integral  integrate(......) is divergent"
>> Diagnosis[46]:  "Division by zero in function foo()"
>> etc
>>     
>
> I dunno. I'm pretty much opposed to creating still more global lists
> for this purpose.
ok, instead of NoObject[45]    or  no_object[45]   or even   
no_object(45), we could have

no_object(45, "The integral integrate(...) is divergent")

if the message were small enough, or [if larger] abbreviated. 

But you could have nesting.. e.g.

no_object(47, no_object(45)+no_object(44)).     But that wouldn't be 
right because 45 and 44 must be expanded
so
no_object(47, no_object(45, "division by zero in ...)+ no_object(44, 
"the integral ...))

and in general the no_object would look kind of like the whole 
computation "quoted".
I think that an interactive debugging session would look better with 
just  no_object(47),
and then separate diagnosis.


>  There are already too many such lists in Maxima;
> there is no way to know where to look for something, except by
> reading the code and/or asking someone else. It's just as easy to
> attach any context info to the reported object itself.
>   
I hope that the illustration above suggests why it is not just as useful.
> The context info need not be displayed by default.
Maybe.
>  Maybe grind
> should print it, since grind is supposed to print stuff readably.
> Or maybe it should be attached as a property so it is accessible
> through "get".
>   
get(no_object(45),diagnosis)   would be OK, especially since you could 
do this:
diagnosis(x):=get(no_object(x),diagnosis)...
but I doubt that "get" is an especially good idea on non-atomic symbols.

RJF