I was having an interesting discussion with Travis yesterday about pragmas and their syntax. This was an extension of a long thread about pragmas on the vwnc mailing list. We were discussing what it was about pragmas we liked and didn't like.
One message about pragmas that seems to have been lost on the thread is what they are. They're actually two things; a) attributes - which lets you store any metadata you want on a method, b) a new syntax for defining attributes in your source code.
Now, you could drive the method attributes from a UI without adding the special syntax - and some people do (I even do in some of my code), but the discussion was more about the special syntax that was added to VisualWorks and why it matters.
Travis notes that the method signature is also not Smalltalk code - it is in fact more metadata to the compiled method. If you look at CompiledMethod, to find its selector it needs to reflect off the class it is installed on.
So why do we blend the source code to a method with the signature of a method? Well, pragmatism. It's incredibly convenient to be able to edit the signature with the code itself. When you stop to think about it - pragmas are the same. Is it easier to pull down a menu to define an attribute on a method, or easy enough just to write some code that you can copy, paste, move around, edit - all in the same place that's contextually bound to the method you're actually working on...
I think the answer is pretty obvious to most of us. So the idea is simple enough, the body of a method contains more information than just the methods code. We interpret its source code to extract more information out of it than just the executable portion.
I have no problems with this and I tend to wonder if this approach will lead us in new directions down the road too... who knows.