unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* I don't want to maintain this
@ 2005-11-28  4:25 Bruce Korb
  2005-11-29  8:16 ` Ludovic Courtès
                   ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: Bruce Korb @ 2005-11-28  4:25 UTC (permalink / raw)


Hi all,

The following function is disliked by me and disliked by Guile 1.7.
It is a PITA to maintain, but it is compulsory until there is equivalent
functionality available.  It is crucially important that error messages
point to the source file where the problem lies.

More and more installations seem to have 1.7, but I still deal with 1.4.
So, I use stuff like SCM_ROCHARS, except that it has been completely
removed from the interface leaving me with hard errors.  I've spent a
day and a half trying to fix this stuff and it is very resistant to
being fixed.

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.  This is "The Right Way" for the interface and "The Wrong Way"
for me.  Can you please add this (or something similar) to your interface
and reinstate SCM_ROCHARS et al. please?  Thank you.

Regards, Bruce

SCM
ag_scm_c_eval_string_from_file_line( tCC* pzExpr, tCC* pzFile, int line )
{
    SCM port;

    if (OPT_VALUE_TRACE >= TRACE_EVERYTHING) {
        fprintf( pfTrace, "eval from file %s line %d:\n%s\n", pzFile, line,
                 pzExpr );
    }

    {
        tSCC zEx[] = "eval-string-from-file-line";
        SCM  expr  = scm_makfrom0str( pzExpr );
        port = scm_mkstrport( SCM_INUM0, expr, SCM_OPN | SCM_RDNG, zEx );
    }

    {
        static SCM file = SCM_UNDEFINED;
        scm_t_port* pt;

        if (  (file == SCM_UNDEFINED)
           || (strcmp( SCM_CHARS( file ), pzFile ) != 0) )
            file = scm_makfrom0str( pzFile );

        pt = SCM_PTAB_ENTRY(port);
        pt->line_number = line - 1;
        pt->file_name   = file;
    }

    {
        SCM ans = SCM_UNSPECIFIED;

        /* Read expressions from that port; ignore the values.  */
        for (;;) {
            SCM form = scm_read( port );
            if (SCM_EOF_OBJECT_P( form ))
                break;
            ans = scm_primitive_eval_x( form );
        }

        return ans;
    }
}

P.S.  Speaking of error messages:

$ autogen --trace=every --trace-out=trace.log -L../autoopts opts.def
ERROR: In procedure inexact?:
ERROR: Wrong type argument in position 1: #<unspecified>

Some deprecated features have been used.  Set the environment
variable GUILE_WARN_DEPRECATED to "detailed" and rerun the
program to get more information.  Set it to "no" to suppress
this message.
Scheme evaluation error.  AutoGen ABEND-ing in template
        options on line 86

============== trace.log ====================
== See the entry for "options line 86", below.
== "suffix", "count", "dne" and "exist?" are all functions legally defined
== and this all works with Guile 1.6. If I *ONLY* had a clue about what
== was being said above ``In procedure inexact?:'' and
== ``#<unspecified>''.  It is just so nebulous.
==
eval from file options line 19:
(define have-cb-procs     (make-hash-table 31))
eval from file options line 20:
(define is-ext-cb-proc    (make-hash-table 31))
eval from file options line 21:
(define cb-proc-name      (make-hash-table 31))
eval from file options line 22:
(define test-proc-name    (make-hash-table 31))
eval from file options line 23:
(define disable-name      (make-hash-table 31))
eval from file options line 24:
(define disable-prefix    (make-hash-table 31))
eval from file options line 25:
(define ifdef-ed          (make-hash-table 31))
eval from file options line 26:
(define extract-fmt       "\n/* extracted from %s near line %d */\n")
eval from file options line 28:
(setenv "SHELL" "/bin/sh")
Starting h template
EXPR       ( B) in options at line 78
eval from file options line 78:
(dne " *  " "/*  ")
Text       (11) in options at line 78
CASE       ( 1) in options at line 82
eval from file options line 82:
(suffix)
CASE string `h' COMPARE_FULL matched `h'
EXPR       ( B) in options at line 86
eval from file options line 86:
(if (not (exist? "flag.name"))
      (error "No options have been defined" ))

  (if (> (count "flag") 100)
      (error (sprintf "%d options are too many - limit of 100"
                  (count "flag")) ))
eval from file autogen.c line 213:
(if (> (string-length shell-cleanup) 0)    (shell shell-cleanup) )


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2005-12-14 21:54 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-28  4:25 I don't want to maintain this Bruce Korb
2005-11-29  8:16 ` Ludovic Courtès
2005-11-29 20:14   ` Bruce Korb
2005-11-30  8:39     ` Ludovic Courtès
2005-11-30 12:30       ` Bruce Korb
2005-11-30 13:46         ` Ludovic Courtès
2005-11-30 14:00           ` Bruce Korb
2005-11-30 14:44             ` Getting source location information Ludovic Courtès
2005-11-30 15:30               ` Bruce Korb
2005-11-30 16:04                 ` Ludovic Courtès
2005-11-30 16:58                   ` Bruce Korb
2005-11-30 17:39                     ` Ludovic Courtès
2005-12-01 12:19                       ` Ludovic Courtès
2005-11-30 19:00                   ` Rob Browning
2005-11-30 20:53                     ` Bruce Korb
2005-11-30 22:35                       ` Rob Browning
2005-11-30 23:30                         ` Bruce Korb
2005-12-14 21:54                           ` Kevin Ryde
2005-11-30 23:45                 ` Han-Wen Nienhuys
2005-12-01  0:30 ` I don't want to maintain this Kevin Ryde
2005-12-01  0:38 ` Kevin Ryde
2005-12-07  0:36   ` Marius Vollmer

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).