guile-devel
[Top][All Lists]
Advanced

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

Re: No way out.


From: Bruce Korb
Subject: Re: No way out.
Date: Sun, 4 Dec 2005 20:08:00 -0800
User-agent: KMail/1.7.1

On Wednesday 30 November 2005 04:44 pm, Kevin Ryde wrote:
> Collateral damage from the change to scm_inexact_p (other message).
> Not sure how one or both ought to work.

All *_p functions ought to accept anything without throwing an error.
Even if it doesn't seem to make sense.  That way, I know I don't have
to validate before calling a validation routine.  :-}

Anyway,  *real bugs* in Guile 1.7.2 are:

1.  When an error is thrown, "exit" should be called with EXIT_FAILURE, not 0.

2.  After these commands:

    (use-modules (ice-9 stack-catch))
    (debug-enable 'backtrace)

    I should be getting stack traces on Scheme errors.  I'm not.
    (And, yes, I invoke either ``(backtrace)'' or ``scm_backtrace()''
    when a failure is detected.)

3.  Either of these two implementations:

    port = scm_open_input_string( AG_SCM_STR02SCM( pzExpr ));
#if GUILE_VERSION < 107000
    {
        static SCM   file = SCM_UNDEFINED;
        static char* pzFl = NULL;
        scm_t_port*  pt;
        if (  (pzFl == NULL)
           || (strcmp( AG_SCM_CHARS( file ), pzFile ) != 0) )  {
            if (pzFl != NULL)
                free(pzFl);
            pzFl = strdup( pzFile );
            file = AG_SCM_STR02SCM( pzFile );
        }
        pt = SCM_PTAB_ENTRY(port);
        pt->line_number = line - 1;
        pt->file_name   = file;
    }
#else
    {
        static SCM file = SCM_UNDEFINED;
        static char* pzOldFile = NULL;
        if ((pzOldFile == NULL) || (strcmp( pzOldFile, pzFile ) != 0)) {
            if (pzOldFile != NULL)
                free( pzOldFile );
            pzOldFile = strdup( pzFile );
            file = scm_from_locale_string( pzFile );
        }
        scm_set_port_filename_x( port, file );
    }
    {
        SCM ln = scm_from_int( line );
        scm_set_port_line_x( port, ln );
    }
#endif

    should be enabling file and line numbers in errors.  I've tried both methods
    with 1.7 (and some others suggested in the discussion), to no avail.  I can
    get file and line information for 1.6.7 and earlier *only*.  There seems to
    be no way to do it in 1.7.

Thanks for your help!  Regards, Bruce




reply via email to

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