In this meta-challenge, you will score your own atomic-code-golf submissions. More precisely, you will need to write a program P in language L such that the atomic-score of P is produced by P.
Score
The idea behind atomic-code-golf is to count language tokens instead of bytes. However, in practice, it is hard to define a general set of rules for all questions (see Count big-ints/symbols/variables as N tokens in atomic-code-golf). That's why it is recommended to clarify rules for each challenge.
Intuitively, tokens are nodes in the abstract syntax tree of your language, except for strings, where each character count (due to potential abuse).
Things that count as single tokens:
- variable/function/type identifiers
- literals, except strings, where each byte counts
- built-in keywords and operators
- (edit) Empty lists, empty vectors, empty strings
Things that are ignored from counting:
- preprocessor/reader macros
- include/import statements
- separating and grouping symbols used to build tuples, lists, arrays, statements, function parameters, structs are ignored (
,;:(){}[]<>|
). However, if those symbols are tokens, they count (I am looking at you, CJam (or Brainfuck)). Also, quotes enclosing strings are not counted.
Corner cases
- Using identifiers to hold data is a nice hack (see feersum's comment), but it might be considered abusive. So, there should be a penaly of +25 if your answer exploits identifiers' names for computations. This penalty needs not be correctly scored by your program. If you manage to add a penalty to programs which abuse identifiers' names for computation (for a reasonable subset of programs in your language), you deserve -100 points of bonus (this bonus needs not be correctly scored by your program).
Challenge
You should write a program in the language of your choice that scores programs in that language according to the above atomic-score rules. Your own answer will be scored according to that program.
- Input may be read from STDIN or given as a function parameter
- Output is a number, as a return value or printed to STDOUT
- Answer with lowest atomic-score wins
- I'll provide an example answer (if it has the lowest score, the next one wins).