gcl-devel
[Top][All Lists]
Advanced

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

Re: [Gcl-devel] ignore-errors


From: Camm Maguire
Subject: Re: [Gcl-devel] ignore-errors
Date: 21 Mar 2004 09:57:36 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Greetings, and welcome to GCL.

First to use ANSI features such as this, please use or build an ansi
image.  GCL can build both ANSI and CLtL1 (the earlier lisp standard)
images. 

Using an ANSI image, here is what I get:

=============================================================================
>(ignore-errors (oddp '(1 2)))

NIL
#<CONDITIONS::INTERNAL-TYPE-ERROR.1>

>(oddp '(1 2))

Error in ODDP [or a callee]: (1 2) is not of type INTEGER.

Fast links are on: do (use-fast-links nil) for debugging
Broken at ODDP.  Type :H for Help.
 1 (Abort) Return to top level.
dbl:>>1

Top level.
>(ignore-errors (oddp 1))

T

>(oddp 1)

T

>
=============================================================================

Please let us know if you have further questions.  If you are building
GCL yourself, add --enable-ansi to the command line of './configure'.

Take care,

"Steve Eichblatt" <address@hidden> writes:

> Hi,
> 
> I am new to lisp. Please let me know if this is the wrong forum for this
> type of question.
> 
> I am looking for a way to trap (and possibly ignore) error messages
> generated within a function call. Something like in Python:
> 
> try:  
>   something
> except:
>   pass
> 
> I have read about a function ignore-errors, but it's not defined by
> default in gcl. 
> 
> I found a way to call it, using:
> 
> (load "/usr/local/gcl-2.5.2/clcs/loading.lisp")
> (load "/usr/local/gcl-2.5.2/clcs/package.lisp")
> (load "/usr/local/gcl-2.5.2/clcs/clcs_handler.lisp")
> 
> which defines the macro ignore-errors (i don't know how to make this
> less implementation-dependent)
> 
> However, it doesn't work like i was expecting.
> 
> >(conditions:ignore-errors (oddp 1))
>  
> T
>  
> >(conditions:ignore-errors (oddp 0))
>  
> NIL
> 
> >(conditions:ignore-errors (oddp '(1 2)))
>  
> Error: (1 2) is not of type INTEGER.
> Fast links are on: do (si::use-fast-links nil) for debugging
> Error signalled by ODDP.
> Broken at ODDP.  Type :H for Help.
> 
> I was expecting the last call to return NIL, based on my interpretation
> of Steele's book:
> 
> "If no ... condition is signaled, any values returned by the last form
> are returned by ignore-errors. Otherwise, two values are returned: nil
> and the error condition that was signaled."
> 
> Thanks in advance,
> 
> -- 
> Steve Eichblatt
> address@hidden
> 
> 
> _______________________________________________
> Gcl-devel mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/gcl-devel
> 
> 
> 

-- 
Camm Maguire                                            address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah




reply via email to

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