Re: open-read/open-write

Yann LeCun <[email protected]> Tue, 10 Nov 2009 08:01:07 -0500
Newsgroups gmane.lisp.lush.devel
Organization Courant Institute, NYU
Message-ID <[email protected]>
Yes, I object.

For an interactive srcipt language it's nice to have a function that
just throws an error, but for a "real" programming language, you need
one that just tells you the file doesn't exist so your program can
take corrective actions and not crash and burn (like fopen() in C).

The solution is to keep the current open-write/read/append as they are
(changing them would break too many things), but to add another set
higher-level function that throws errors (although that is kind of
what "(reading <file> ....)" does).

I don't have any good sugestions for name. Perhaps
file-open-r file-open-w file-open-a, or something.

  -- Yann


On Tuesday 10 November 2009, Ralf Juengling wrote:
> The functions 'open-read' and 'open-write' do not
> raise errors. The current behavior is this:
> 
> "The empty list is returned when an error occurs while
> opening the file. .."
> 
> I can see that this may be useful. But I believe the
> alternative behavior--open-read/write raising an error and
> printing an informative error message when the operation
> fails--is useful more often than the current behavior.
> 
> Does anybody remember why the current behavior was chosen?
> Does anybody object if I change open-read/open-write (and
> open-append) in lush2 to raise errors?
> 
> Ralf
> 
> 
> ---------------------------------------------------------------------------
> --- Let Crystal Reports handle the reporting - Free Crystal Reports 2008
>  30-Day trial. Simplify your report design, integration and deployment -
>  and focus on what you do best, core application coding. Discover what's
>  new with Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Lush-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/lush-devel
> 


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july