guile-user
[Top][All Lists]
Advanced

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

scsh and ice-9 regex interaction


From: Thomas Mulcahy
Subject: scsh and ice-9 regex interaction
Date: Fri, 4 Jul 2003 21:42:59 -0400 (EDT)

Hi. I would like to be able to use both the
scsh modules and the ice-9 regex modules.
I realize that these libraries define some of the same
symbols, so code in one file cannot use both.
Therefore, I defined a scsh-stuff module in one file:

(define-module (scsh-stuff)
  :use-module (scsh syntax)
  :use-module (scsh syntax-helpers)
  :use-module (scsh procobj)
  :use-module (scsh scsh)
  :use-module (scsh fdports))
;; some procedure definitions that use scsh would
;; presumably be here, but nothing is needed for the 
;; purposes of this test

Then I have a file that would presumably use the
definitions in scsh-stuff, but, for simplicity,
doesn't

;; commenting out the following line fixes the problem
(use-modules (scsh-stuff))
(use-modules (ice-9 regex))

(define dir-regexp (make-regexp ".*/"))
(define (path->dir file-path)
  (match:substring (regexp-exec dir-regexp
file-path)))

(display (path->dir "/tmp/blah.txt"))
(newline)

Here are my results when I try to test
guile> (load "test.scm")
test.scm:6:20: In procedure regexp-exec in expression
(regexp-exec dir-regexp file-path):
test.scm:6:20: invalid regular expression
ABORT: (regular-expression-syntax)

And here is a backtrace
Backtrace:
In unknown file:
   ?: 0* [primitive-load "test.scm"]
In test.scm:
   8: 1* [display ...
   8: 2*  [path->dir "/tmp/blah.txt"]
   6: 3   [match:substring ...
   6: 4*   [regexp-exec #<regexp 80aa3c8>
"/tmp/blah.txt"]

So my question are:
Is this behaviour expected? i.e. Should I file a bug
report?
If not, how can I use different modules so that they
don't interfere with each other?

Thanks,
Thomas

______________________________________________________________________ 
Post your free ad now! http://personals.yahoo.ca




reply via email to

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