Marco van Hulten
unread,Jul 23, 2023, 11:27:05 AM7/23/23Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to hle...@googlegroups.com
Hi all,
The syntax of a balance assertion is the same as of an assignment (if
one limits hirself to a single line instead of the full transaction).
As a consequence, sometimes I modify an assertion's balance by one
cent, just to assert myself that I actually did a balance assertion
instead of an assignment.
Consider this example:
2023-01-01 * Equity
Assets 100 €
Equity:Opening balance
2023-01-02 * Assertion after income
Assets 10 € = 110 €
Income
2023-01-03 * Assignment (lost a bill)
Assets = 105 €
Adjustment
2023-01-04 * Assertion after income, written differently
Assets = 130 €
Income -25 €
By changing the last assert to 131 €, the assertion fails. When
changing an assignment, I would not get an error so I know it is an
assignment (which I never want to use).
Nonetheless, even this awkward check can go wrong. When I change the
panultimate assignment from 105 € to 120 €, I get an error as well.
This time, of course not from this transaction but from the last
transaction, but I might not notice and incorrectly conclude that the
panultimate "transaction" contains a balance assertion.
I propose to introduce
:= for single-commodity assignment
:== for multi-commodity assignment
:=* and :==* are invalid
and disallow =, ==, =* and ==* for assignments.
If this is not possible (because of ambiguous syntax parsing or
breaking with ledger), another approach is to include an option to
disallow assignments, e.g. one of the following
--disallow-assignments
check noassignments
What do you think?
Marco