[pure-lang-svn] SF.net SVN: pure-lang:[665] pure/trunk/lib
Status: Beta
Brought to you by:
agraef
|
From: <ag...@us...> - 2008-08-30 19:15:54
|
Revision: 665
http://pure-lang.svn.sourceforge.net/pure-lang/?rev=665&view=rev
Author: agraef
Date: 2008-08-30 19:16:04 +0000 (Sat, 30 Aug 2008)
Log Message:
-----------
Add malloc_error symbol.
Modified Paths:
--------------
pure/trunk/lib/prelude.pure
pure/trunk/lib/system.pure
Modified: pure/trunk/lib/prelude.pure
===================================================================
--- pure/trunk/lib/prelude.pure 2008-08-30 02:20:55 UTC (rev 664)
+++ pure/trunk/lib/prelude.pure 2008-08-30 19:16:04 UTC (rev 665)
@@ -34,6 +34,7 @@
In particular, the 'bad_list_value' exception is raised by functions which
need to work from the end of a list towards its front. */
+nullary malloc_error; // memory allocation error
nullary out_of_bounds; // tuple or list index is out of bounds (!)
// bad_list_value xs; // not a proper list value (reverse, etc.)
// xs denotes the offending tail of the list
Modified: pure/trunk/lib/system.pure
===================================================================
--- pure/trunk/lib/system.pure 2008-08-30 02:20:55 UTC (rev 664)
+++ pure/trunk/lib/system.pure 2008-08-30 19:16:04 UTC (rev 665)
@@ -329,7 +329,7 @@
else free buf $$ throw printf_error res;
end;
do_sprintf (u,_) _ = throw printf_arg_error;
- check_buf buf = throw printf_malloc_error if null buf;
+ check_buf buf = throw malloc_error if null buf;
= buf otherwise;
end;
@@ -400,7 +400,7 @@
ret = if res>=0 then ret else throw (scanf_error ret);
end;
do_fscanf _ (_,ret) _ = throw (this_cant_happen ret);
- check_buf buf = throw scanf_malloc_error if null buf;
+ check_buf buf = throw malloc_error if null buf;
= buf otherwise;
// Compute a reasonable size for a string buffer; if necessary, modify the
// field width of the format accordingly.
@@ -495,7 +495,7 @@
u = drop res u;
end;
do_sscanf (_,_,ret) _ = throw (this_cant_happen ret);
- check_buf buf = throw scanf_malloc_error if null buf;
+ check_buf buf = throw malloc_error if null buf;
= buf otherwise;
// Compute a reasonable size for a string buffer; if necessary, modify the
// field width of the format accordingly.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|