* symbol defined cannot be found.
@ 2004-06-23 14:45 Steven Wu
2004-07-01 21:53 ` Neil Jerram
0 siblings, 1 reply; 2+ messages in thread
From: Steven Wu @ 2004-06-23 14:45 UTC (permalink / raw)
I tried a little trick learned from this list, when the attached script
is run with argument, it goes into interactive mode. That part works,
however, when after getting into interactive mode, the variable
dmr-tracers and run-log-trace symbol cannot be found. I wonder why this
is the case.
steve
---
#!/bin/sh
# -*- scheme -*-
main='(module-ref (resolve-module '\''(dmr pythia)) '\'main')'
exec ${GUILE-guile} -l $0 -c "(apply $main (cdr (command-line)))" "$@"
!#
;;; pythia -- Build log analyzer
;;;
;;; usage: pythia [-r|--project-root] [-R|--posix-proj-root]
;;; [-l|--log-file file] [-p|--patch-list file]
;;;
(define-module (dmr pythia)
:autoload (ice-9 getopt-long) (getopt-long)
:use-module (ice-9 readline)
:use-module (ice-9 rdelim)
:use-module (ice-9 pretty-print)
:use-module (ice-9 regex)
:export (pythia))
(define dmr-tracers '())
(define (run-log-trace)
(write-line "run log trace"))
(define (interactive-mode)
(set-repl-prompt! "pythia> ")
(activate-readline)
(top-repl))
(define (pythia . args)
(let* ((parsed-opts (getopt-long
(cons "pythia" args)
'((root (single-char #\r) (value #t))
(posix-root (single-char #\p) (value #t))
(mcp-log (single-char #\m) (value #t))
(liberty-log (single-char #\l) (value #t))
(wim-log (single-char #\w) (value #t))
(x86-log (single-char #\x) (value #t)))))
(mcp-log (option-ref parsed-opts 'mcp-log #f))
(liberty-log (option-ref parsed-opts 'liberty-log #f))
(wim-log (option-ref parsed-opts 'wim-log #f))
(x86-log (option-ref parsed-opts 'x86-log #f))
(root (option-ref parsed-opts 'root #f))
(posix-root (option-ref parsed-opts 'posix-root #f)))
(if (= 0 (length args))
(interactive-mode)
(if (and root posix-root)
(begin
(write-line mcp-log)
(cond
(mcp-log (write-line mcp-log))
(liberty-log (write-line liberty-log))
(wim-log (write-line wim-log))
(x86-log (write-line x86-log)))
(run-log-trace))))))
(define main pythia)
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: symbol defined cannot be found.
2004-06-23 14:45 symbol defined cannot be found Steven Wu
@ 2004-07-01 21:53 ` Neil Jerram
0 siblings, 0 replies; 2+ messages in thread
From: Neil Jerram @ 2004-07-01 21:53 UTC (permalink / raw)
Cc: Guile Gnu
Steven Wu wrote:
> I tried a little trick learned from this list, when the attached
> script is run with argument, it goes into interactive mode. That part
> works, however, when after getting into interactive mode, the variable
> dmr-tracers and run-log-trace symbol cannot be found. I wonder why
> this is the case.
Because (top-repl) switches into the (guile-user) module, from where
these procs are not visible. It should work if you do:
1. (named-module-use! '(guile-user) '(dmr pythia))
2. export run-log-trace and dmr-tracers from (dmr pythia).
Regards,
Neil
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-07-01 21:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-23 14:45 symbol defined cannot be found Steven Wu
2004-07-01 21:53 ` Neil Jerram
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).