chicken-hackers
[Top][All Lists]
Advanced

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

[Chicken-hackers] Reporting undefined symbols


From: Alaric Snell-Pym
Subject: [Chicken-hackers] Reporting undefined symbols
Date: Sun, 12 Sep 2010 09:35:03 +0100
User-agent: Mozilla/5.0 (X11; U; NetBSD amd64; en-US; rv:1.9.1.9) Gecko/20100520 Lightning/1.0b2pre Shredder/3.0.4


Hi there!

I was frustrated by an annoying message of the form:

Warning: reference to possibly unbound identifier: archive

Error: module unresolved: ugarit-core

...when just about *every* procedure in ugarit-core has an 'archive'
parameter.

I tracked it down in the end by noting that the unbound identifier
warnings come out in order, and deliberately putting three unbound
identifiers in the file (one at the top, one at the bottom, one halfway
up) and thereby finding which half of the file the identifier reference
was in, then moving the markers inwards in a binary chop search.

However, I also tried dipping into chicken-core to see if more useful
context could be revealed; a line number would be great, but even just
the name of the top-level define we're in would be good. My quest took
me to expand.scm, where I found that the module record has an unresolved
symbol list, but I became Puzzled as I tried to trace how things got
into it. ##sys#register-undefined registers undefined symbols, but it
only seems to be called by this ##sys#alias-global-hook which is in turn
called only by ##sys#strip-syntax, and I'm not sufficiently versed in
Chicken internals to work out what's what above that, as it's called in
lots of places.

I see that it's called directly inside many of the core macro
definitions inside that file; would it therefore suffice to define a
parameter for the "current top-level definition" and set it to the
defined name in the macro expanders for DEFINE, DEFINE-SYNTAX, and any
others, and if that parameter is not at its default value of #f, report
it in errors (and make the unbound identifier list for the module be a
list of pairs, mapping unbound identifiers to the top-level definitions
they're in?

Would that work, or is strip-syntax called in other dynamic contexts?

ABS

--
Alaric Snell-Pym
http://www.snell-pym.org.uk/alaric/



reply via email to

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