Previously, FOO was evaluated to return a scope, and BAR was an
identifier looked up in that scope. However, this prevented scope-local
functions from being called (since that is a CALL, not a plain IDENT).
Now the meaning of the "." operator is that it evaluates the left
operand in a scope type context, pushes that scope as the current object
context, and then evaluates BAR in that context.
Thus the bare word "amount" in an account context calls the same
function that "account.amount" would if evaluated in a posting context.
Thus, an expression can know if the context in which it's being
evaluated requires a string, and if so, determine it's output
accordingly. For example:
account ; returns the full name of the posting's account
account.total ; here the context is SCOPE, so account is an obj
The different namespaces are:
Function Value expression functions, which receive a "context"
Option Command-line options
Precommand Commands which are invoked before reading the journal
Command Commands which are invoked after reading the journal
Directive Directives that occur at column 0 in a data file
This greatly eases the ability for Python uses to add intercept hooks to
change how the basic Ledger module functions. An example of what should
be possible soon:
import ledger
def my_foo_handler(value):
print "--foo received:", value
ledger.add_handler(ledger.Option, "foo=", my_foo_handler)
These strings are now collected automagically in the file po/ledger.pot.
If you'd like to produce a translation, just run this command after
building Ledger:
msginit -l LOCALE -o LANG.po -i po/ledger.pot
Where LOCALE is a string like de or en_GB, and LANG is a short
descriptive word for your language.
Then send me this .po file so I can commit it to the Ledger sources
(alternatively, you could maintain the file in a fork on GitHub), and
setup the build script to format and install your new message catalog
during a "make install".
In the old scheme, nested values would simply flatten and concatenate,
so that '((1, 2), 3) = (1, 2, 3)'. Now sublists are preserved, so that
sequences may be passed as arguments to functions.