W00t! The word &#39;pragma&#39; completely confused me. It made me think Perl pragma. Annotation to my ear (and this may just be me) implies more than what these things do. When I hear the word annotation, I think of something more like a class comment. <div>
<br></div><div>Tag is a perfect word for it. Please let&#39;s call them tags sooner than later! I hope it sticks.<br><br><div class="gmail_quote">On Fri, Apr 30, 2010 at 12:00 AM, Travis Griggs <span dir="ltr">&lt;<a href="mailto:travisgriggs@gmail.com">travisgriggs@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im"><br>
On Apr 29, 2010, at 8:23 PM, Andreas Raab wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 4/29/2010 1:23 PM, Travis Griggs wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Weighing in on a 2 day dead topic is probably passe` around here... :)<br>
</blockquote>
<br>
It&#39;s not quite dead yet :-)<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
2) I push, at ever juncture I can, the term &lt;tagged methods&gt; and &lt;method<br>
tags&gt;. The &lt;tag&gt; term grew on me for a set of reasons.<br>
</blockquote>
<br>
I think that&#39;s a great term. It doesn&#39;t have the compiler connotations of &quot;pragma&quot;, is shorter than &quot;annotation&quot; yet very concise and flexible. I like the sound of, e.g., &quot;the apicall tag instructs the compiler to generate the code for some FFI call&quot;, &quot;the preference tag allows discovery of preferences&quot;, the &quot;type tag can be used to annotate variables&quot;. It really works for me.<br>

<br>
In fact, I raise my hand and vote for renaming Pragma to MethodTag :-)<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
3) You can get carried away with &lt;method tags&gt;. It&#39;s tempting to grow<br>
little micro-DSLs with these things. They don&#39;t scale well for that.<br>
They&#39;re far from turing complete, and you&#39;re limited to literal objects.<br>
Best example of this is the nightmare that the method tags for menus<br>
were turning into VW. I wrote about this here:<br>
<br>
<a href="http://www.cincomsmalltalk.com/userblogs/travis/blogView?showComments=true&amp;printTitle=Menu_Items_Are_Objects_Too&amp;entry=3354355944" target="_blank">http://www.cincomsmalltalk.com/userblogs/travis/blogView?showComments=true&amp;printTitle=Menu_Items_Are_Objects_Too&amp;entry=3354355944</a><br>

</blockquote>
<br>
I&#39;ve discussed this particular issue with Eliot at length in order to understand what caused these issues. I agree with the conclusion that it&#39;s dangerous to use method tags as DSLs, and that if the level of fine-grained control one needs reaches the level you&#39;re describing in your post, tags are not the solution.<br>

</blockquote>
<br></div>
I think it&#39;s more fundamental than that. It&#39;s that if you&#39;re not careful, you end up with a tag that&#39;s trying to serve two masters. It&#39;s trying to be something that can be used to discover the method, and at the same time encode the construction of a seemingly simple object.<br>

<br>
Or maybe another way to put it is this. No idea if I can make this make sense. A tag is about meta data. It is very cool that in and of itself, it is a Smalltalk message syntax. It&#39;s a message about the message. As long as it is strictly about the real method, then to me, that makes sense. It fits in the meta sense. But when what I really have, is two pieces of behavior, one which describes a UI element, and another which describes something associated with the behavior, then that type of construct belongs in Smalltalk, where it&#39;s methods all the way down, where we implement mixtures of messages all the time. What happened with the Menu stuff, and what it appears may happen with your preferences stuff, at least from my cursory reading, is that you end up using the &lt;tag&gt; as a way of coupling two co-equal pieces of data.<br>

<br>
For example, the menu stuff evolved over time to look like:<br>
<br>
arbitraryMethod<br>
        &lt;stuff:that:encodes:how:to:wrap:this:behavior:in:a:very:specific:UI:implementation&gt;<br>
        <br>
        self<br>
                doSomeLogic;<br>
                maybeCheckSomething;<br>
                decideWhetherWeShouldContinueToGoOn;<br>
                goAndDoSomething<br>
<br>
But why not the other way around?<br>
<br>
arbitraryMethod<br>
        &lt;menuMethodAction: #selectorToSend receiverAspect: #messageToGetReceiver arguments: #(#literal &#39;arguments&#39;)&gt;<br>
<br>
        ^MenuItem<br>
                labeleled: &#39;Blah&#39;;<br>
                group: &#39;Whatever&#39;;<br>
                hopefullyYouGetThePoint;<br>
                yourself<br>
<br>
<br>
I could just as easily write an AutomaticMenuAugmentationCementMixer that worked just as well this way. Instead of limitations about what kind of UI&#39;s I could wrap around the action, I would have traded it for limitations in what kind of action I could express for my menu item object. Or I could have split it another way.<div class="im">
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
However, that doesn&#39;t preclude their use for a small set of menu declarations that we&#39;d like to support going forward. Read the full argument here:<br>
</blockquote>
<br></div>
I&#39;m not sure what your threshold for &quot;small&quot; would have been. Before we added the last and final &lt;menu method tag&gt; to &quot;rule them all&quot;, VisualWorks had reached no less than 13 variants of the tag, with no end in sight. We were needing more. I&#39;m reasonably sure that it didn&#39;t start out with 13, it started out with just a &quot;small set&quot;, a sort of quick and easy shorthand for &quot;the common cases.&quot;<br>

<br>
One problem with this sort of 4GL&#39;ification that was layered on top of VisualWorks 1.0 in this and other areas, was that you create an interesting dilemma for the programmer. There&#39;s two different ways of defining a Menu action now. I can go the supposed easy way with a quick tag shorthand notation, or I can send real messages. When do I choose which approach? How do I know when to give up on the one, and switch to the other? How do I swap back and forth? IMO, the effort is usually better spent making your API simple and easy to discover and use messages all the way down.<div class="im">
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<a href="http://squeakingalong.wordpress.com/2010/04/27/annotations-for-service-discovery/" target="_blank">http://squeakingalong.wordpress.com/2010/04/27/annotations-for-service-discovery/</a><br>
</blockquote>
<br>
<br></div>
Read.<br>
<br>
Twice now.<br>
<br>
Good stuff.<br>
<br>
Discovery good.<br>
<br>
Piggybacking other stuff into the discovery packet, bad. :)<br><font color="#888888">
<br>
--<br>
Travis Griggs<br>
Objologist<br>
&quot;I did not have time to write you a short program, so I wrote you a long one instead.&quot;<br>
<br>
<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Casey Ransberger<br>
</div>