Hi guys,
Over the holidays I decided to organize my finances, and I decided to try
ledger based on the depth and breadth of the documentation. Lots of the
problems that I have had with double-entry accounting were explained
cogently in the ledger docs so thanks for that! But I've had a few problems
in adjusting and I thought I'd ask about them in case someone could set me
straight.
One in particular is the difference between value expressions and query
expressions. It seems like these two things are different and even parsed
differently. In particular, the function "has_tag" referred to by the man
page is valid in ledger expr but not valid in ledger query. Instead, to do
the same thing, you do something like tag /^TAG$/.. is this right? It works
in an automated transaction, but not in ledger query.
I think either the two things should be unified or a bigger distinction
should be drawn between them in the documentation. I spent an awful lot of
time trying to use has_tag in an automated expression without luck. In
particular, when I tried:
= expr has_tag("TAG")
I got parse errors at the command line:
While parsing file "/home/ethan/tmp/tiny-ledger.dat", line 4:
While parsing value expression:
has_tag("TAG"
While parsing automated transaction:
> = expr has_tag("TAG")
Error: Invalid token '<end of input>' (wanted ')')
And without expr, it doesn't match anything.
Ethan