Juliusz Chroboczek <j...@irif.fr> writes:

>> In this example, parsing the custom format in Python would be something like:
>
> No, parsing input using string.split is always incorrect. You really
> want to write a proper lexer.
>
> The lexer I posted above is 70 lines of C, including full error
> checking. In Python, it's probably 15 to 20 lines. Is it really worth
> switching to a bloated and unreadable format in order to avoid 20
> lines of code in each client?

Well, it is of course completely up to you where you want to set the
barrier to entry for interacting with babeld. And if you want to set
that at "being able to write a lexer", well, that is a tradeoff. Just
don't be surprised when people try to do sscanf or string.split-style
parsing anyway, and subsequently complain about the interface. But then
I guess you do like educating people, so maybe that is all well and
good... ;)

-Toke

_______________________________________________
Babel-users mailing list
Babel-users@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/babel-users

Reply via email to