[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Guile's return value
From: |
Thien-Thi Nguyen |
Subject: |
Re: Guile's return value |
Date: |
Tue, 13 Sep 2005 10:10:01 -0400 |
From: address@hidden (Ludovic =?iso-8859-1?Q?Court=E8s?=)
Date: Tue, 13 Sep 2005 13:00:45 +0200
However, is there a reason for Guile's return value to be independent
of the expression evaluated? I think it would make sense, especially
for scripts, to have Guile behave according to the expression(s)
evaluated.
Even uncaught exceptions yield a zero return value, which doesn't
sound like a very good idea.
bash seems to agree as well:
$ sh -c false ; echo $?
1
$ echo false > bad ; sh bad ; echo $?
1
here is the excerpt from libguile/script.c that implements the current
behavior (along w/ the discarding of the -c expression's value):
/* After doing all the other actions prescribed by the command
line, quit. */
tail = scm_cons (scm_cons (sym_quit, SCM_EOL), tail);
i suppose whoever wrote that expected explicit `exit' or `quit' to be
used to communicate exit value w/ the caller, which is not unreasonable.
thi