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