guile-devel
[Top][All Lists]
Advanced

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

Re: I don't want to maintain this


From: Ludovic Courtès
Subject: Re: I don't want to maintain this
Date: Tue, 29 Nov 2005 09:16:06 +0100
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux)

Hi,

Bruce Korb <address@hidden> writes:

> Grumble, grumble.  Anyway, this belongs in your code.  We argued about this
> before and someone said, "well, you could do it in any of several ways,
> so we won't do it at all."  This function is entirely equivalent to
> "scm_c_eval_string" except that error results show file name and line 
> number.

Sorry if I'm just re-stating what you were already answered: Can't you
implement this as a small Scheme procedure?  Something along the lines
of:

  (read-enable 'positions)

  (define (eval-from-file file)
    (with-input-from-file file
      (lambda ()
        (let loop ((sexp (read))
                   (result #f))
          (if (eof-object? sexp)
              result
              (begin
                (format #t "evaluating `~a' from ~a:~a:~a~%"
                        sexp (port-filename (current-input-port))
                        (source-property sexp 'line)
                        (source-property sexp 'column))
                (loop (read) (primitive-eval sexp))))))))

This would certainly be easier for you to maintain.

Thanks,
Ludovic.




reply via email to

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