source: to-imperative/trunk/java/refal/refal/plus/StreamErr.rf @ 3989

Last change on this file since 3989 was 3614, checked in by yura, 13 years ago
  • Refal Library on Refal+ is coped to java - folder java contais both java and refal.
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 920 bytes
Line 
1// $Id: StreamErr.rf 3614 2008-03-29 22:03:50Z orlov $
2
3//X/$functor Stream-Error (S : IndexedStream) (P : Stream-Position);
4
5$use Arithm Box StdIO;
6
7
8$box Error_Box;
9/*
10 * Format: ... ((e.name) (s.row s.column) (e.message)) ...
11 */
12
13//** $func Errors = errors;
14//** $func Clear-Errors = ;
15
16Errors = <Get &Error_Box>;
17
18Clear_Errors = <Store &Error_Box /*empty*/>;
19
20
21//** $func Error    stream e.message = ;
22//** $func Error-At t.pos  e.message = ;
23
24Error stream e.message =
25  <Put &Error_Box       (() (0 0) (e.message))>;
26//X/    <Put &Error-Box
27//X/            ((<S.Name stream>) (<S.Row stream> <"-" <S.Column stream> 1>) (e.message))>;
28
29Error_At t.pos e.message =
30  <Put &Error_Box       (() (0 0) (e.message))>;
31//X/    <Put &Error-Box
32//X/            ((<P.Name t.pos>) (<P.Row t.pos> <P.Column t.pos>) (e.message))>;
33
34
35//** $func Print-Errors = ;
36
37Print_Errors, {
38  <Errors> : e ((e.name) (s.row s.col) (e.message)) e,
39    <PrintLn e.name": "s.row", "s.col" --- Error: "e.message>,
40    $fail;;
41};
42
43
Note: See TracBrowser for help on using the repository browser.