Hi eliot
+1.�� I can't stress enough how useful it is to make pragmas real selectors with implementations and to try and apply them using perform:withArguments:. That's when their real power comes in.
For example, if you have some method that wants to be added to some tool, make its pragma a message with all the information you need to add it as arguments (things like its position or priority relative to other additions, its name in the list of components, an icon to use, a string for fly-by help) and then implement a builder class whose methods match these pragmas so that when the builder performs the pragma it adds the method to the tool, in a given position, with a given icon and fly-by help etc.
In most other systems method annotations are simply that, just passive labels.�� But in Smalltalk these are executable.�� You can browse for senders and implementors, you can execute them using a visitor pattern.�� Much more powerful.
For the pragmas paper I read about annotation in Java and from what I learned they are more powerful in Java.
They can annotate any language elements and they can also be executed (I have to discuss with a Java expert to get it).
@Entity @Table(name = "EMPLOYEE")In the case of Hibernate, these annotation are for a class and they are used at *runtime* to bind the class instances with database entries (elements of this class are stored in the table EMPLOYEE).
method = obj.getClass().getMethod(methodName, param1.class, param2.class, ..);method.invoke(obj, arg1, arg2,...);And this way you execute a method named "Table", "name" or "EMPLOYEE" with the parameter you want, as you could execute a method from any string matching a method name. We have the same primitive in Pharo on CompiledMethod.
Stef