bug-guile
[Top][All Lists]
Advanced

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

source-properties versus set-source-properties!


From: Kevin Ryde
Subject: source-properties versus set-source-properties!
Date: Sat, 22 Mar 2003 00:48:52 +1000
User-agent: Gnus/5.090013 (Oort Gnus v0.13) Emacs/21.2 (i386-pc-linux-gnu)

In guile 1.6.3 built on a recent i386 debian, it seems
source-properties and set-source-properties! don't really cooperate.

For instance a file foo.scm,

        (define x '(1 2 3))
        (define y '(4 5 6))

        (set-source-properties! y (source-properties x))

        (display (source-properties x)) (newline)
        (display (source-properties y)) (newline)

run with "guile --debug -s foo.scm" prints

   ((breakpoint . #f) (line . 0) (column . 11) (filename . foo.scm))
   ()

whereas I hoped it would print two lines the same, having copied the
properties from x onto y.


Nosing around srcprops.c, I guess set-source-properties! will put an
alist in the hash table, but source-properties won't return that,
instead always returning '() for anything except an srcprops object.

If source-property and set-source-property! are to be believed then I
guess either an srcprops or an alist is allowed in the hash, perhaps
on that basis source-properties should simply return verbatim what it
finds in the hash if it's not an srcprops.  Ie. "return SCM_EOL" would
become "return p".




reply via email to

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