Hi Denis,

2015-04-09 11:40 GMT+02:00 Denis Kudriashov <dionisiydk@gmail.com>:
Hi.
I read this long long thread. And too me #example is good common name for any kind of examples. I really don't want to think what pragma I should use for concrete scenario. All existed methods are just examples. No care is they return instances or not.

Yes, most of thisdepends on some "conventions". And, looking at the image, it seems that most methods
that are named like #exampleXXX are from some Morphc/Widget/UI classes that really *open* some example.

That is, if you want to show the user how to *use* your class to open some Widgets or Morphs or Browsers,
most of the time this is done with a #exampleXXX method.

(And most of them doesn't even return an instance of this class! For example, all the SpecModel classes
provide some example methods that will return the result of using this model, for Example:

ListModel new openWithSpec

will return a WindowModel

��

So I am not understand what the problem with example methods which not return instance of class?

There are methods named #exampleXXX that
- "open" something (the UI-Widget examples for example open a widget/window/dialog ...)
- create an instance for the object class this method is defined (see all methods tagged with pragma <gtExample>

��
And what concrete tool you try to implement?
The little "play-icon" in Nautilus currently depends on the method name, if it is named #exapleXXX, treat
it as example method that *opens something*
GTInspector provides a "instance example" (E.g.)-tab. You can see a list of example methods that *create instances* (and inspect them)

��

If it is special "examples" tab when inpecting/browsing classes why it should be restricted to working only with instances of given class?

If it *opens* a window/ a Morph or anything else, this is a side-effect the glamour team don't want, because they intend to use this example-instance-creation for other
things as well (for example: automatic testing).

��
Your tool can analize result of example method and provide different kind of interfaces. And with instance of selected class it will work as you already implemented.
��
And with example from Athens it can provide tools to control tiger demo (for example)

Best regards,
Denis


2015-04-09 9:48 GMT+03:00 Tudor Girba <tudor@tudorgirba.com>:
I would not do that. I think that removing the example pragma check is sufficient for now. Could we do it?

Cheers,
Doru

On Wed, Apr 8, 2015 at 5:16 PM, Nicolai Hess <nicolaihess@web.de> wrote:


2015-04-08 10:20 GMT+02:00 Tudor Girba <tudor@tudorgirba.com>:

And, to have a better chance of having a clean slate discussion later on in which to consider the value we associate to names, I would like to remove the <example> check from isExampleMethod and continue to preserve the treatment of #example* selectors in Nautilus.


Wouldn't we need to change the check to:

isExampleMethod
���� if selector starts with 'example' *AND HAS NOT* a <example> (or <gtExample>) pragma

because there are tons of #example* methods, some of them open an example and some of them with the pragma, create an instance for the inspector?



��



--

"Every thing has its own flow"