Re: [Pharo-dev] [squeak-dev] Pragma keyword / selector / methodSelector
On 15.11.2016, at 22:08, Denis Kudriashov <dionisiydk@gmail.com> wrote:
2016-11-15 21:58 GMT+01:00 Tobias Pape <Das.Linux@gmx.de>: Here's my 2ct:
1. Pragmas aren't actually pragmas. They do not instruct the compiler to do things (_except_ for primitive: and apicall:, but these are now outliers). They rather add metadata to a (compiled) method. 2. The 'thing' (ie, class) should probably be named MethodAnnotation 3. We can have the cake and eat it to:
Rename Pragma -> MethodAnnotation. Make Pragma a new subclass of MethodAnnotation. Make MethodAnnotation implement #methodSelector #annotationSelector (or #selector, if it must be) Make Pragma implement #selector #keywords
I remember long discussion about Pragma vs Annotation name where Igor won completely :)). Conclusion was that Pragma is a right name.
The German wiktionary is more on the compiler-side: * Pragma: eine Steueranweisung im Quellcode für einen Compiler oder einen Interpreter, die den Programmablauf nicht direkt beeinflusst, die aber Auswirkungen auf bestimmte Ãberprüfungen des Quellcodes hat (Control statment for compiler/interpreter that does not directly change control flow but has effect on code checking)⦠Sources for this usage: * âEin Pragma - auch Pseudo-lnstruktion genannt - leitet einfach Informationen an den Compiler weiter und wird nicht zu einem Teil des ausführbaren Programms.â [Steven Feuerstein, Bill Pribyl: Oracle PL/SQL Programmierung (Safari Books Online), 2. Auflage 2003, ISBN 389721184X, Seite 85] (a pragma - aka pseudo instruction - directs simple information to the compiler and _will not be part_ of the executable) (emphasis mine) English wiktionary likewise: ⢠(computing, programming) A compiler directive; data embedded in source code by programmers to indicate some intention to the compiler. This pragma stops the compiler from generating those warnings we don't care about. And also wikipedia: https://en.wikipedia.org/wiki/Directive_(programming) ¯\_(ã)_/¯ Best regards -Tobias
participants (1)
-
Tobias Pape