On 1/10/14 16:30, Tudor Girba wrote:
Hi,
Indeed, the goal of State is to show the raw state of every object. In
case we miss something, we should add that. Sven, if you see that this
is not happening, let's start on a case to case basis.
Doru call it "raw" and not state. Especially if state may interpret the
state
Btw, if you want to know what gets shown in State, you can simply
inspect the result of Object>>#gtInspectorVariableValuePairs. You can
also override that for your own objects if you want. You can see a
post explaining this here:
http://www.humane-assessment.com/blog/extending-variables-shown-in-gtinspector/
The default view is specified by the order. So, the first view is the
default one. We made the State view has order 10. If you define a view
with a lower order, it will appear first. We have to experiment here
with different objects. For example, for collections, a better default
view would be the items. We did not do that until now in order to not
alienate even more the users. But, I think now it's time to do it.
yes
Cheers,
Doru
On Wed, Oct 1, 2014 at 4:22 PM, Marcus Denker <[email protected]
<mailto:[email protected]>> wrote:
On 01 Oct 2014, at 15:08, Sven Van Caekenberghe <[email protected]
<mailto:[email protected]>> wrote:
> I am confused about the GTInspector State tab. What is its
definition ?
>
> I would say that it shows the raw, fundamental, implementation
form of the object, in essence what EyeBasicInspector showed. And
that additional tabs offer alternative, more user friendly views.
>
> Why then does it not show all variable content and only named
variables ?
>
> Try inspecting a [Byte]String or [Byte]Array. The State view is
useless, it just shows self. Some of these have an items view, but
not all.
>
> How can I inspect an individual character of a String ? Or an
individual byte ?
>
> Consider a Float. The State view should show the two
(meaningless) slots because that is how Floats are (currently)
implemented, and then another tab should show the sign, mantissa,
exponent view.
>
> In the Eye inspectors we also confused these two aspects in a
single view, which is wrong in hindsight, IMHO. It should be
crystal clear for a user whether a slot is real or an alternative
view of describing the same thing.
>
> I could propose changes or a slice, but I think we should agree
on the definition of 'State' first.
>
I think this is just a matter of iterating, e.g. Dictionary has it
already correct:
State show the raw state (array, tally), while the “items” view
shows nicely
key->values.
an example where it fails is CompiledMethod, it has a Bytecode
view, but in addition a (virtual) “all byte codes” variable in the
raw view. (and more).
I think we need
-> the raw state for every object (like the old basic inspector)
-> this might not be the default view for all objects, though.
(the default should present something useful).
This means, maybe having the notion of a default view would be
nice.
-> work to add more views to everything interesting.
Marcus
--
www.tudorgirba.com <http://www.tudorgirba.com>
"Every thing has its own flow"