[Nix-dev] Trace/error messages: manipulating locations.
Nicolas Pierron
nicolas.b.pierron at gmail.com
Tue Jul 14 15:12:17 CEST 2009
On Tue, Jul 14, 2009 at 14:32, Marc Weber<marco-oweber at gmx.de> wrote:
> I agree that having
> would be much nicer. Add __FILE__ AND __LINE__ or better __SOURCE_LOC__
> to the nix language and I consider changing that. This feature would be
> useful for options as well.
Indeed this could be helpful to generate relevant error messages, but
I disagree about the method. These functions are related to error
handlers and you don't want to see them leaking in your operating
code. Such kind of function should be retrieved from the location of
annotated syntax elements.
# return the file which contains the definition of this attribute if any.
attrLoc = name: set: builtins.attrLoc name set;
--
Nicolas Pierron
http://www.linkedin.com/in/nicolasbpierron
Donald Knuth - I can't go to a restaurant because I keep looking at
the fonts on the menu.
More information about the nix-dev
mailing list