Re: Yet another newB attempting a scheme alg...
- From: "ncruces@xxxxxxxxx" <ncruces@xxxxxxxxx>
- Date: 12 Apr 2006 19:33:06 -0700
Not for any useful definition of "guarantees failure" it doesn't. The
R5RS says that it is "an error" to take the car and cdr of an empty
list. That means that all bets are off regarding how the program will
behave. A particular Scheme system may choose to signal the error --
the R5RS encourages them to do so -- but there is no guarantee that
others will. They could instead return some arbitrary value. -max
I know, and you are absolutely (if a bit pedantically) correct. I
should never have said it guaranteed a thing - it only makes it as much
an error as taking the car or cdr (whichever happens first) of the
empty list.
Now, as a matter of taste, I choose to use languages (and/or
implementations) where these kinds of errors are indeed flagged, so
that I don't need to perform those sanity checks by myself all the
time. But that's just me.
.
- References:
- Yet another newB attempting a scheme alg...
- From: olybiz
- Re: Yet another newB attempting a scheme alg...
- From: H.
- Re: Yet another newB attempting a scheme alg...
- From: Jussi Piitulainen
- Re: Yet another newB attempting a scheme alg...
- From: ncruces@xxxxxxxxx
- Re: Yet another newB attempting a scheme alg...
- From: Max Hailperin
- Yet another newB attempting a scheme alg...
- Prev by Date: Re: newb question about lists
- Next by Date: Re: Yet another newB attempting a scheme alg...
- Previous by thread: Re: Yet another newB attempting a scheme alg...
- Next by thread: Re: Yet another newB attempting a scheme alg...
- Index(es):
Relevant Pages
|