* Re: source-properties versus set-source-properties!
[not found] <87n0joyduz.fsf@zip.com.au>
@ 2003-07-20 22:47 ` Kevin Ryde
2003-08-08 23:14 ` Kevin Ryde
0 siblings, 1 reply; 2+ messages in thread
From: Kevin Ryde @ 2003-07-20 22:47 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 581 bytes --]
Another followup from a while ago,
* srcprop.c (scm_source_properties): Return plist from hash if it's a
list set by source-properties! rather than an SRCPROPS object,
* tests/srcprop.test: New file.
* Makefile.am (SCM_TESTS): Add it.
Maybe set-source-properties! should store an srcprop object like the
comments say, but this change at least lets source-properties and
set-source-properties! cooperate (currently what's set can't be read).
This problem is also present in the 1.6 branch, if it's important
enough to be worth addressing there.
[-- Attachment #2: srcprop.c.source-plist.diff --]
[-- Type: text/plain, Size: 354 bytes --]
--- srcprop.c.~1.62.~ 2003-05-22 11:39:33.000000000 +1000
+++ srcprop.c 2003-07-20 12:31:08.000000000 +1000
@@ -161,7 +161,8 @@
p = scm_hashq_ref (scm_source_whash, obj, SCM_BOOL_F);
if (SRCPROPSP (p))
return scm_srcprops_to_plist (p);
- return SCM_EOL;
+ else
+ return p; /* plist from set-source-properties! */
}
#undef FUNC_NAME
[-- Attachment #3: srcprop.test --]
[-- Type: text/plain, Size: 1684 bytes --]
;;;; srcprop.test --- test Guile source properties -*- scheme -*-
;;;;
;;;; Copyright (C) 2003 Free Software Foundation, Inc.
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
;;;; License as published by the Free Software Foundation; either
;;;; version 2.1 of the License, or (at your option) any later version.
;;;;
;;;; This library is distributed in the hope that it will be useful,
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;;;; Lesser General Public License for more details.
;;;;
;;;; You should have received a copy of the GNU Lesser General Public
;;;; License along with this library; if not, write to the Free Software
;;;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(use-modules (test-suite lib))
;;;
;;; source-properties
;;;
(with-test-prefix "source-properties"
(read-enable 'positions)
(let ((s (read (open-input-string "(1 . 2)"))))
(pass-if "read properties"
(not (null? (source-properties s))))))
;;;
;;; source-properties!
;;;
(with-test-prefix "source-properties!"
(read-enable 'positions)
(let ((s (read (open-input-string "(1 . 2)"))))
(with-test-prefix "copied props"
(pass-if "visible to source-property"
(let ((t (cons 3 4)))
(set-source-properties! t (source-properties s))
(number? (source-property t 'line))))
(pass-if "visible to source-properties"
(let ((t (cons 3 4)))
(set-source-properties! t (source-properties s))
(not (null? (source-properties t))))))))
[-- Attachment #4: Makefile.am.srcprop.diff --]
[-- Type: text/plain, Size: 326 bytes --]
--- Makefile.am.~1.14.~ 2003-06-19 11:44:00.000000000 +1000
+++ Makefile.am 2003-07-20 12:32:28.000000000 +1000
@@ -28,6 +28,7 @@
tests/r4rs.test \
tests/reader.test \
tests/regexp.test \
+ tests/srcprop.test \
tests/srfi-1.test \
tests/srfi-6.test \
tests/srfi-10.test \
[-- Attachment #5: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: source-properties versus set-source-properties!
2003-07-20 22:47 ` source-properties versus set-source-properties! Kevin Ryde
@ 2003-08-08 23:14 ` Kevin Ryde
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Ryde @ 2003-08-08 23:14 UTC (permalink / raw)
I wrote:
>
> * srcprop.c (scm_source_properties): Return plist from hash if it's a
> list set by source-properties! rather than an SRCPROPS object,
I realized I needed SCM_EOL as the default in the hash call, but
otherwise I applied this, and I made an executive decision and applied
it to the 1.6 branch too, so source-properties and
set-source-properties! will cooperate.
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-08-08 23:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <87n0joyduz.fsf@zip.com.au>
2003-07-20 22:47 ` source-properties versus set-source-properties! Kevin Ryde
2003-08-08 23:14 ` Kevin Ryde
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).