Hi
In my projects I start to do the following: I create <examplar> class method that returns an prototypical instance. I use such methods in my tests as fixture. Then I would like to have nautilus presenting to me the <examplar> with a little triangle and when I press on them I get an inspector on them. This way I get the same behavior than with default <example> methods that open an widget, image.... If we agree on that - I can take all the <example> and turn them if necessary into examplar. - extend Nautilus to send an inspect to the result of examplar tagged method. I think that we can achieve a lot in terms of discovery with such simple changes. Stef PS: I reread the old thread and I think that this is a reasonable approach that makes the pro instances (like me) and the pro examples showing some things (like me) happy. |
Hi 2016-08-18 14:38 GMT+02:00 stepharo <[hidden email]>: Hi |
example is meant to be something executable from the browser (and with a visible result) while “exemplar” will just provide a prototype.
this is old discussion, sigh... Esteban
|
In reply to this post by Denis Kudriashov
Apparently from the old discussion, people like <example> to prompt and open the example when this is something visual. This is ok for me. In my proposal we can get the best of both worlds. - instance to use in tests - instance to learn and tweak with GTInspector - examples that we can see opening. Stef
|
In reply to this post by stepharo
Hi all
I implemented the <examplar> to behave as suggested by torsten and it is available in less than 5 min (I loved it). An example is JUST a class method returning an instance. CTGrid class >> grid22 <examplar> "self grid22" | grid1 | grid1 := self new: 2. grid1 atRow: 1 atColumn: 1 put: 1. grid1 atRow: 1 atColumn: 2 put: 3. grid1 atRow: 2 atColumn: 1 put: 2. grid1 atRow: 2 atColumn: 2 put: 4. ^ grid1 You can use this method as any class method in the past. NOTHING new!! So in particular your test can use it to build a fixture (yes reuse). You can use this method in several test cases (yes reuse). Now nautilus supports nicely <examplar> methods: you can execute them and get a cool GTInspector open on them. So this is similar to the method exampleSomething from Nautilus point of view. And now people can use example to create/open/... their lovely examples (that may not return instances). And we get examplar methods that must return an instance but can behave as example from Nautilus perspective. https://pharo.fogbugz.com/f/cases/18964/support-examplar If you want to try you can load the CTGrid packages ScriptLoader new unloadPackageNamed: 'Collections-Grid'. ScriptLoader new unloadPackageNamed: 'Collections-Grid-Tests'. "Because there were not good and will be removed from the image" Gofer it url: 'http://smalltalkhub.com/mc/StephaneDucasse/Containers/main'; configurationOf: 'Grid'; loadStable Click on class side of CTGrid and press the triangle and yes you get an inspector on this instance. Stef Le 18/8/16 à 14:38, stepharo a écrit : > Hi > > In my projects I start to do the following: > > I create <examplar> class method that returns an prototypical instance. > > I use such methods in my tests as fixture. > > Then I would like to have nautilus presenting to me the <examplar> > with a little triangle and when I press > > on them I get an inspector on them. > > This way I get the same behavior than with default <example> methods > that open an widget, image.... > > If we agree on that > > - I can take all the <example> and turn them if necessary into > examplar. > > - extend Nautilus to send an inspect to the result of examplar > tagged method. > > I think that we can achieve a lot in terms of discovery with such > simple changes. > > Stef > > PS: I reread the old thread and I think that this is a reasonable > approach that makes > > the pro instances (like me) and the pro examples showing some things > (like me) happy. > > > |
Le 18/8/16 à 21:31, stepharo a écrit : > Hi all > > I implemented the <examplar> to behave as suggested by torsten and it > is available in less than 5 min (I loved it). An example is JUST a > class method returning an instance. examplar is JUST... :) > > CTGrid class >> grid22 > <examplar> > "self grid22" > | grid1 | > grid1 := self new: 2. > grid1 atRow: 1 atColumn: 1 put: 1. > grid1 atRow: 1 atColumn: 2 put: 3. > grid1 atRow: 2 atColumn: 1 put: 2. > grid1 atRow: 2 atColumn: 2 put: 4. > ^ grid1 > > You can use this method as any class method in the past. NOTHING new!! > So in particular your test can use it to build a fixture (yes reuse). > You can use this method in several test cases (yes reuse). > > > Now nautilus supports nicely <examplar> methods: you can execute them > and get a cool GTInspector open on them. So this is similar to the > method exampleSomething from Nautilus point of view. And now people > can use example to create/open/... their lovely examples (that may not > return instances). And we get examplar methods that must return an > instance but can behave as example from Nautilus perspective. > > https://pharo.fogbugz.com/f/cases/18964/support-examplar > > If you want to try you can load the CTGrid packages > > ScriptLoader new unloadPackageNamed: 'Collections-Grid'. > ScriptLoader new unloadPackageNamed: 'Collections-Grid-Tests'. > "Because there were not good and will be removed from the image" > Gofer it > url: 'http://smalltalkhub.com/mc/StephaneDucasse/Containers/main'; > configurationOf: 'Grid'; > loadStable > > Click on class side of CTGrid and press the triangle and yes you get > an inspector on this instance. > > Stef > > > > > > Le 18/8/16 à 14:38, stepharo a écrit : >> Hi >> >> In my projects I start to do the following: >> >> I create <examplar> class method that returns an prototypical instance. >> >> I use such methods in my tests as fixture. >> >> Then I would like to have nautilus presenting to me the <examplar> >> with a little triangle and when I press >> >> on them I get an inspector on them. >> >> This way I get the same behavior than with default <example> methods >> that open an widget, image.... >> >> If we agree on that >> >> - I can take all the <example> and turn them if necessary into >> examplar. >> >> - extend Nautilus to send an inspect to the result of examplar >> tagged method. >> >> I think that we can achieve a lot in terms of discovery with such >> simple changes. >> >> Stef >> >> PS: I reread the old thread and I think that this is a reasonable >> approach that makes >> >> the pro instances (like me) and the pro examples showing some things >> (like me) happy. >> >> >> > > > |
In reply to this post by stepharo
|
In reply to this post by stepharo
On 18/08/16 14:38, stepharo wrote:
> Hi > > In my projects I start to do the following: > > I create <examplar> class method that returns an prototypical instance. Nice. Excellent inititive. I'm not a native speaker, and <exemplar> does not sound like the right name for this to me. That might be me being dutch. Native speakers, is this the right name to use? Stephan |
In reply to this post by stepharo
2016-08-18 19:50 GMT+02:00 stepharo <[hidden email]>:
Ok, let's distinguish them. Scripts are scripts (maybe <script> is better name than <example>?) I thought that we don't need two options because in practice <example> only opens morph or inspector. And for morphs we already have morph tab in inspector. So morph examples could be easily converted to <examplar> without any loss. In my proposal we can get the best of both worlds. |
Hi,
I am happy to see the concept of an example method catching attention again. As explained before, the GTExample was already present in the Pharo image, but it was introduced more as a helper for testing GT extensions. Now, I just created an issue for removing GTExamples from the GT-Inspector package and from the main Pharo image: https://pharo.fogbugz.com/f/cases/18965/Remove-GTExample-from-the-GT-Inspector-package Cheers, Doru > On Aug 18, 2016, at 10:45 PM, Denis Kudriashov <[hidden email]> wrote: > > > 2016-08-18 19:50 GMT+02:00 stepharo <[hidden email]>: >> Hi >> >> Why not use <example> pragma in the way you propose for <examplar>? Why we need two? > > Apparently from the old discussion, people like <example> to prompt and open the example > when this is something visual. This is ok for me. > > Ok, let's distinguish them. Scripts are scripts (maybe <script> is better name than <example>?) > > I thought that we don't need two options because in practice <example> only opens morph or inspector. And for morphs we already have morph tab in inspector. So morph examples could be easily converted to <examplar> without any loss. > > In my proposal we can get the best of both worlds. > - instance to use in tests > - instance to learn and tweak with GTInspector > - examples that we can see opening. > > -- www.tudorgirba.com www.feenk.com "Every thing should have the right to be different." |
In reply to this post by Denis Kudriashov
2016-08-18 22:45 GMT+02:00 Denis Kudriashov <[hidden email]>:
some <example> methods don't just show a morph that you want to inspect, but a Morph that you want to interact with. And not all Morphs render well in the inspectors Morph tab. <script> - execute some code, don't care about the return value <example> - create an (UI/Morph)-example you can interact with <exemplar> - create an example instance. I like all three of them and can see a value for every single one.
|
In reply to this post by Stephan Eggermont-3
2016-08-18 17:30 GMT-03:00 Stephan Eggermont <[hidden email]>:
> On 18/08/16 14:38, stepharo wrote: >> >> Hi >> >> In my projects I start to do the following: >> >> I create <examplar> class method that returns an prototypical instance. > > > Nice. Excellent inititive. I'm not a native speaker, and <exemplar> does not > sound like the right name for this to me. That might be me being dutch. > Native speakers, is this the right name to use? Semantically it is correct, but for me, also maybe by not being a native English speaker, sounds weird. I'd use something like "sample". However I'll be fine with whatever you choose. But I'd choose something that doesn't sound weird to native English readers, we already have some cases of that. Regards, Esteban A. Maringolo |
On Fri, Aug 19, 2016 at 5:09 AM, Esteban A. Maringolo
<[hidden email]> wrote: > 2016-08-18 17:30 GMT-03:00 Stephan Eggermont <[hidden email]>: >> On 18/08/16 14:38, stepharo wrote: >>> >>> Hi >>> >>> In my projects I start to do the following: >>> >>> I create <examplar> class method that returns an prototypical instance. >> >> >> Nice. Excellent inititive. I'm not a native speaker, and <exemplar> does not >> sound like the right name for this to me. That might be me being dutch. >> Native speakers, is this the right name to use? > > Semantically it is correct, but for me, also maybe by not being a > native English speaker, sounds weird. > > I'd use something like "sample". However I'll be fine with whatever > you choose. But I'd choose something that doesn't sound weird to > native English readers, we already have some cases of that. > > Regards, > > > Esteban A. Maringolo > In the previous thread I argued against <exemplar> and for <sample>, but I'm not so strong in my conviction to push it again :). The former is a little exotic, but is sufficient -- and perhaps its useful <example> and <exemplar> sound similar with just a minor difference at the end. P.S. In terms of discover-ability about this difference, a passing thought is it would be nice for newcomers to be able to hover over a code like a pragma and get a tool tip popup. cheers -ben |
In reply to this post by Nicolai Hess-3-2
@Denis there was a long debate a while ago and I do not want to rediscuss it. Personnally I have no preconceived points on naming. I want just a way to get instance and that people are happy and that the solution stay ridiculously simple.
@Nicolai Me too. So we are in sync :) I wonder where we can document that. I would have changed <example> into <popupExample>/<interactiveExample> And it is not a dogma for me. Just to make sure that we move on. Because I got student changing my "<examplar>" not tagged method to add an inspect call, not fun when running my tests :) but it was clear that they wanted to have an inspector to tweak the object.
|
In reply to this post by Ben Coman
Let me know. I do not care about examplar or sample.
Let us pick one that works well. I thought about prototype but this is too close to prototype based language. So we could get <interactiveExample> <sample>/<instance>/ Le 19/8/16 à 01:59, Ben Coman a écrit : > On Fri, Aug 19, 2016 at 5:09 AM, Esteban A. Maringolo > <[hidden email]> wrote: >> 2016-08-18 17:30 GMT-03:00 Stephan Eggermont <[hidden email]>: >>> On 18/08/16 14:38, stepharo wrote: >>>> Hi >>>> >>>> In my projects I start to do the following: >>>> >>>> I create <examplar> class method that returns an prototypical instance. >>> >>> Nice. Excellent inititive. I'm not a native speaker, and <exemplar> does not >>> sound like the right name for this to me. That might be me being dutch. >>> Native speakers, is this the right name to use? >> Semantically it is correct, but for me, also maybe by not being a >> native English speaker, sounds weird. >> >> I'd use something like "sample". However I'll be fine with whatever >> you choose. But I'd choose something that doesn't sound weird to >> native English readers, we already have some cases of that. >> >> Regards, >> >> >> Esteban A. Maringolo >> > In the previous thread I argued against <exemplar> and for <sample>, > but I'm not so strong in my conviction to push it again :). The > former is a little exotic, but is sufficient -- and perhaps its useful > <example> and <exemplar> sound similar with just a minor difference at > the end. > > P.S. In terms of discover-ability about this difference, a passing > thought is it would be nice for newcomers to be able to hover over a > code like a pragma and get a tool tip popup. > > cheers -ben > > |
Hi,
I strongly believe that the interaction should not be hardcoded in the example pragma name. That is because you will want all sorts of interactions once you go beyond the surface. For example, a Roassal visualization, a Bloc element, and a Morph are all interesting from an interaction point of view, but there are different ways to open them (and having it polymorphic does not quite make sense). Cheers, Doru > On Aug 19, 2016, at 9:52 AM, stepharo <[hidden email]> wrote: > > Let me know. I do not care about examplar or sample. > > Let us pick one that works well. I thought about prototype but this is too close to prototype based language. > > So we could get > > <interactiveExample> > > <sample>/<instance>/ > > > Le 19/8/16 à 01:59, Ben Coman a écrit : >> On Fri, Aug 19, 2016 at 5:09 AM, Esteban A. Maringolo >> <[hidden email]> wrote: >>> 2016-08-18 17:30 GMT-03:00 Stephan Eggermont <[hidden email]>: >>>> On 18/08/16 14:38, stepharo wrote: >>>>> Hi >>>>> >>>>> In my projects I start to do the following: >>>>> >>>>> I create <examplar> class method that returns an prototypical instance. >>>> >>>> Nice. Excellent inititive. I'm not a native speaker, and <exemplar> does not >>>> sound like the right name for this to me. That might be me being dutch. >>>> Native speakers, is this the right name to use? >>> Semantically it is correct, but for me, also maybe by not being a >>> native English speaker, sounds weird. >>> >>> I'd use something like "sample". However I'll be fine with whatever >>> you choose. But I'd choose something that doesn't sound weird to >>> native English readers, we already have some cases of that. >>> >>> Regards, >>> >>> >>> Esteban A. Maringolo >>> >> In the previous thread I argued against <exemplar> and for <sample>, >> but I'm not so strong in my conviction to push it again :). The >> former is a little exotic, but is sufficient -- and perhaps its useful >> <example> and <exemplar> sound similar with just a minor difference at >> the end. >> >> P.S. In terms of discover-ability about this difference, a passing >> thought is it would be nice for newcomers to be able to hover over a >> code like a pragma and get a tool tip popup. >> >> cheers -ben >> >> > > -- www.tudorgirba.com www.feenk.com "Next time you see your life passing by, say 'hi' and get to know her." |
Le 19/8/16 à 10:18, Tudor Girba a écrit : > Hi, > > I strongly believe that the interaction should not be hardcoded in the example pragma name. That is because you will want all sorts of interactions once you go beyond the surface. For example, a Roassal visualization, a Bloc element, and a Morph are all interesting from an interaction point of view, but there are different ways to open them (and having it polymorphic does not quite make sense). sorry but I cannot understand what you mean. You suggest to use example but not to have it polymorphic? > > Cheers, > Doru > > > >> On Aug 19, 2016, at 9:52 AM, stepharo <[hidden email]> wrote: >> >> Let me know. I do not care about examplar or sample. >> >> Let us pick one that works well. I thought about prototype but this is too close to prototype based language. >> >> So we could get >> >> <interactiveExample> >> >> <sample>/<instance>/ >> >> >> Le 19/8/16 à 01:59, Ben Coman a écrit : >>> On Fri, Aug 19, 2016 at 5:09 AM, Esteban A. Maringolo >>> <[hidden email]> wrote: >>>> 2016-08-18 17:30 GMT-03:00 Stephan Eggermont <[hidden email]>: >>>>> On 18/08/16 14:38, stepharo wrote: >>>>>> Hi >>>>>> >>>>>> In my projects I start to do the following: >>>>>> >>>>>> I create <examplar> class method that returns an prototypical instance. >>>>> Nice. Excellent inititive. I'm not a native speaker, and <exemplar> does not >>>>> sound like the right name for this to me. That might be me being dutch. >>>>> Native speakers, is this the right name to use? >>>> Semantically it is correct, but for me, also maybe by not being a >>>> native English speaker, sounds weird. >>>> >>>> I'd use something like "sample". However I'll be fine with whatever >>>> you choose. But I'd choose something that doesn't sound weird to >>>> native English readers, we already have some cases of that. >>>> >>>> Regards, >>>> >>>> >>>> Esteban A. Maringolo >>>> >>> In the previous thread I argued against <exemplar> and for <sample>, >>> but I'm not so strong in my conviction to push it again :). The >>> former is a little exotic, but is sufficient -- and perhaps its useful >>> <example> and <exemplar> sound similar with just a minor difference at >>> the end. >>> >>> P.S. In terms of discover-ability about this difference, a passing >>> thought is it would be nice for newcomers to be able to hover over a >>> code like a pragma and get a tool tip popup. >>> >>> cheers -ben >>> >>> >> > -- > www.tudorgirba.com > www.feenk.com > > "Next time you see your life passing by, say 'hi' and get to know her." > > > > > > |
Administrator
|
In reply to this post by stepharo
In the original thread [1]: - The most popular naming option was for some combination of exampleInstance, exampleCode, sampleInstance, and sampleCode because they are both natural-sounding-to-native-ears and explicit. - There was a small (Ben and I) consensus leaning specifically toward <exampleCode> together with <sampleInstance> - Exemplar (note it's not spelled exAmplar) is a bit obscure English - There were some more exotic parameterized varieties discussed, but maybe it's best to save those for a future evolution [1] http://forum.world.st/lt-example-gt-pragmas-and-example-methods-use-cases-td4833428.html
Cheers,
Sean |
> On 19 Aug 2016, at 17:35, Sean P. DeNigris <[hidden email]> wrote: > > stepharo wrote >> Let me know. I do not care about examplar or sample. > > In the original thread [1]: > - The most popular naming option was for some combination of > exampleInstance, exampleCode, sampleInstance, and sampleCode because they > are both natural-sounding-to-native-ears and explicit. > - There was a small (Ben and I) consensus leaning specifically toward > <exampleCode> together with <sampleInstance> That makes a lot of sense, so +1 And UI stuff would then be a case of <exampleCode> right, as side effect ? > - Exemplar (note it's not spelled exAmplar) is a bit obscure English > - There were some more exotic parameterized varieties discussed, but maybe > it's best to save those for a future evolution > > [1] > http://forum.world.st/lt-example-gt-pragmas-and-example-methods-use-cases-td4833428.html > > > > ----- > Cheers, > Sean > -- > View this message in context: http://forum.world.st/example-examplar-tp4911728p4911947.html > Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com. > |
In reply to this post by stepharo
Hi,
If you attache a certain action such as "result openInWorld” to a pragma such as <interactiveExample>, it implies that when I have a different resulting object that should be spawned with a different message (for example, a Roassal view should be opened with "result open"), I should use a different pragma. That will quickly lead to an explosion of pragmas. Cheers, Doru > On Aug 19, 2016, at 10:32 AM, stepharo <[hidden email]> wrote: > > > > Le 19/8/16 à 10:18, Tudor Girba a écrit : >> Hi, >> >> I strongly believe that the interaction should not be hardcoded in the example pragma name. That is because you will want all sorts of interactions once you go beyond the surface. For example, a Roassal visualization, a Bloc element, and a Morph are all interesting from an interaction point of view, but there are different ways to open them (and having it polymorphic does not quite make sense). > > sorry but I cannot understand what you mean. > You suggest to use example > but not to have it polymorphic? >> >> Cheers, >> Doru >> >> >> >>> On Aug 19, 2016, at 9:52 AM, stepharo <[hidden email]> wrote: >>> >>> Let me know. I do not care about examplar or sample. >>> >>> Let us pick one that works well. I thought about prototype but this is too close to prototype based language. >>> >>> So we could get >>> >>> <interactiveExample> >>> >>> <sample>/<instance>/ >>> >>> >>> Le 19/8/16 à 01:59, Ben Coman a écrit : >>>> On Fri, Aug 19, 2016 at 5:09 AM, Esteban A. Maringolo >>>> <[hidden email]> wrote: >>>>> 2016-08-18 17:30 GMT-03:00 Stephan Eggermont <[hidden email]>: >>>>>> On 18/08/16 14:38, stepharo wrote: >>>>>>> Hi >>>>>>> >>>>>>> In my projects I start to do the following: >>>>>>> >>>>>>> I create <examplar> class method that returns an prototypical instance. >>>>>> Nice. Excellent inititive. I'm not a native speaker, and <exemplar> does not >>>>>> sound like the right name for this to me. That might be me being dutch. >>>>>> Native speakers, is this the right name to use? >>>>> Semantically it is correct, but for me, also maybe by not being a >>>>> native English speaker, sounds weird. >>>>> >>>>> I'd use something like "sample". However I'll be fine with whatever >>>>> you choose. But I'd choose something that doesn't sound weird to >>>>> native English readers, we already have some cases of that. >>>>> >>>>> Regards, >>>>> >>>>> >>>>> Esteban A. Maringolo >>>>> >>>> In the previous thread I argued against <exemplar> and for <sample>, >>>> but I'm not so strong in my conviction to push it again :). The >>>> former is a little exotic, but is sufficient -- and perhaps its useful >>>> <example> and <exemplar> sound similar with just a minor difference at >>>> the end. >>>> >>>> P.S. In terms of discover-ability about this difference, a passing >>>> thought is it would be nice for newcomers to be able to hover over a >>>> code like a pragma and get a tool tip popup. >>>> >>>> cheers -ben >>>> >>>> >>> >> -- >> www.tudorgirba.com >> www.feenk.com >> >> "Next time you see your life passing by, say 'hi' and get to know her." >> >> >> >> >> >> > > -- www.tudorgirba.com www.feenk.com "It's not how it is, it is how we see it." |
Free forum by Nabble | Edit this page |