Re: pipe buffering

2010-09-23 Thread Aidan Gauland
Neil Jerram  ossau.uklinux.net> writes:
> Well, as the manual says:
> 
>  -- Macro: expect clause ...
>  [...]   The procedures
>  are called in turn after each character is read from the port,
>  [...]
> 
>  The test is successful if the procedure returns a non-false value.
> 
> Your lambda returns *unspecified*, which counts as a non-false value.
> So the whole (expect ...) invocation completes after reading just one
> character.

I must've missed that "each character" bit.

Maybe it would be better to post my original program that would just
hang.  I was only using expect to print debugging messages; my
original program used expect-strings.

--Aidan

#! /usr/bin/guile -s
!#

(use-modules (ice-9 expect))
(use-modules (ice-9 popen))

(define ie-io (open-pipe* OPEN_BOTH
  "/usr/bin/telnet"
  "ienabler.canterbury.ac.nz" "259"))
(let ((expect-port ie-io))
  (expect-strings
   ("^User:" (begin (display "[snip]\n" ie-io) (display "gave user")))
   ("^passwd:" (begin (display "[snip]\n" ie-io) (display "gave passwd")





Unbound variable: quote

2010-09-23 Thread Joel James Adamson
Hello,

I'm trying to load a file at the REPL that loads some modules from a
subdirectory then defines a function.  At reading my use-modules
statements, I get the following error:

guile> %load-path
("/home/joel/Public/src/age_dep/sim/trunk" "/usr/share/guile/site" 
"/usr/share/guile/1.8" "/usr/share/guile")
guile> (load "age_dep.scm")

Backtrace:
In unknown file:
...
   ?: 20  (letrec ((load-file #)) (dynamic-wind (lambda () #) (lambda () #) 
...) ...)
   ?: 21* [dynamic-wind # # #]
   ?: 22* [#]
   ?: 23* (let* ((file #)) (cond (# => #) (# => #)))
   ?: 24  [# 
"/home/joel/Public/src/age_dep/sim/trunk/age-dep-scm/age-dep-interface.scm"]
   ?: 25  [with-fluid* # #f #]
   ?: 26* [#]
   ?: 27* [load-file # ...]
   ?: 28* [save-module-excursion #]
   ?: 29  (let (# #) (dynamic-wind # thunk #))
   ?: 30  [dynamic-wind # # #]
   ?: 31* [#]
   ?: 32* [primitive-load 
"/home/joel/Public/src/age_dep/sim/trunk/age-dep-scm/age-dep-interface.scm"]
In /home/joel/Public/src/age_dep/sim/trunk/age-dep-scm/age-dep-interface.scm:
  36: 33* (use-modules (ice-9 popen))
  36: 34  (eval-case (# # *unspecified*) (else #))
  36: 35  (begin (process-use-modules (list (list #))) *unspecified*)
In unknown file:
   ?: 36* [process-use-modules ...
   ?: 37* [list ...
   ?: 38* [list ...
   ?: 39* (quote (ice-9 popen))

: In expression (quote (ice-9 popen)):
: Unbound variable: quote
ABORT: (unbound-variable)

However, at the REPL I can load the popen module just fine (with a
warning):

guile> (use-modules (ice-9 popen))
guile> (use-modules (age-dep-scm age-dep-interface))
WARNING: (guile-user): `quote' imported from both (ice-9 null) and (age-dep-scm 
age-dep-interface)

Why would `quote' be redefined?  What's going on here and how can I fix it?

Thanks,

Joel
-- 
Joel J. Adamson
Servedio Lab
University of North Carolina at Chapel Hill

FSF Member #8164
http://www.unc.edu/~adamsonj


pgpnplCF1AGmq.pgp
Description: PGP signature


Re: pipe buffering

2010-09-23 Thread Aidan Gauland
On Wed, Sep 22, 2010 at 09:17:08PM +0100, Neil Jerram wrote:
> Well, as the manual says:
> 
>  -- Macro: expect clause ...
>  [...]   The procedures
>  are called in turn after each character is read from the port,
>  [...]
> 
>  The test is successful if the procedure returns a non-false value.
> 
> Your lambda returns *unspecified*, which counts as a non-false value.
> So the whole (expect ...) invocation completes after reading just one
> character.

I must've missed that "each character" bit.

Maybe it would be better to post my original program that would just
hang.  I was only using expect to print debugging messages; my
original program used expect-strings.

--Aidan


signature.asc
Description: Digital signature