[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
void as a return value (Re: [Chicken-users] DBI)
From: |
Vincent Manis |
Subject: |
void as a return value (Re: [Chicken-users] DBI) |
Date: |
Wed, 27 Feb 2008 14:42:38 -0800 |
\begin{rant}
On the subject of using void as a return value (rather than to
indicate that
a function or method doesn't return anything), EWWWW.
Please, please, don't ever write functions that return void as
anything other
than an indication that no value was returned.
#;44> (car (db-fetch-row (db-query "select salary where empname='Bilbo
Baggins'")))
#;45>
So now, (a) you get no output, which might be mystifying and (b) car
is now returning
void. Neither of these violates any language rule, but each violates
the Law of
Least Astonishment.
For SQL nulls, one could use '(), as has been mentioned;
alternatively, an object
called the-SQL-null-object could be created (perhaps as a record type
value).
Incidentally, there are several different meanings for null in SQL,
including no
information, not applicable, no value presently exists (but one might
in the future),
etc. You can find lengthy essays on the appropriateness of using NULL
in several
of Chris Date's `Writings on Database' books. People have enough
trouble understanding
SQL null without further conflating it with `this function returns no
values'.
\end{rant}
Sorry :-) -- vincent
- [Chicken-users] DBI, Ozzi Lee, 2008/02/27
- Re: [Chicken-users] DBI, John Cowan, 2008/02/27
- Re: [Chicken-users] DBI, Ozzi Lee, 2008/02/27
- Re: [Chicken-users] DBI, Jeremy Sydik, 2008/02/27
- Re: [Chicken-users] DBI, Peter Bex, 2008/02/27
- Re: [Chicken-users] DBI, Graham Fawcett, 2008/02/27
- Re: [Chicken-users] DBI, Peter Bex, 2008/02/27
- Re: [Chicken-users] DBI, Graham Fawcett, 2008/02/27
- Re: [Chicken-users] DBI, felix winkelmann, 2008/02/28
- void as a return value (Re: [Chicken-users] DBI),
Vincent Manis <=
- Re: void as a return value (Re: [Chicken-users] DBI), Ozzi, 2008/02/27
- Re: void as a return value (Re: [Chicken-users] DBI), John Cowan, 2008/02/27
- Re: void as a return value (Re: [Chicken-users] DBI), Vincent Manis, 2008/02/27
- Re: [Chicken-users] DBI, John Cowan, 2008/02/27
- Re: [Chicken-users] DBI, felix winkelmann, 2008/02/28
- Re: [Chicken-users] DBI, Graham Fawcett, 2008/02/28
- [Chicken-users] New immediate values (was: DBI), Tobia Conforto, 2008/02/28
- Re: [Chicken-users] New immediate values (was: DBI), Graham Fawcett, 2008/02/28
- Re: [Chicken-users] New immediate values (was: DBI), John Cowan, 2008/02/28
- Re: [Chicken-users] New immediate values (was: DBI), Mario Domenech Goulart, 2008/02/29