guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

anonymous lambda file/line


From: Kevin Ryde
Subject: anonymous lambda file/line
Date: Sat, 20 Dec 2003 07:48:05 +1000
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux)

Is the source file and line available for an anonymous procedure when
running under --debug?

I tried, with no luck

        (display (procedure-name (lambda () #f)))
        (newline)
        (display (procedure-properties (lambda () #f)))
        (newline)
        (display (source-properties (procedure-source (lambda () #f))))
        (newline)

When a backtrace or error just says function "#f", it'd be nice to
know where it comes from.  It can be a long way away when throwing
procedures around in lists or whatever.

I was thinking scm_m_lambda could set a name #<lambda foo.scm:123> or
something (which scm_m_define could overwrite if it gets a proper
name).  But if file and line is already hiding somewhere then it'd be
easy enough to just grab that when printing.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]