Changeset 1604


Ignore:
Timestamp:
Nov 23, 2004, 8:46:27 AM (16 years ago)
Author:
orlov
Message:
  • Structured input written in Refal.
Location:
to-imperative/trunk/library
Files:
16 added
1 edited

Legend:

Unmodified
Added
Removed
  • to-imperative/trunk/library/Stream/Stream.rf

    r1603 r1604  
    11// $Id$
     2
     3$module Stream : IStream;
    24
    35$use Box Compare StdIO;
     
    79Stream s.func e.args, {
    810  # <Func? s.func> =
    9     <Lib-Error (Stream Open) "Arg 1 is not a Function">, $fail;
     11    <Lib-Error (Stream Stream) "Arg 1 is not a Function">, $fail;
    1012  <Box () (s.func e.args)>;
    1113};
     
    7375
    7476
    75 *** $func? Get-Delim stream t.delim = expr;
     77*** $func Get-Delim stream t.delim = expr;
    7678
    7779Get-Delim stream t.delim, {
     
    8183        (e.str e1 t.delim) (e2) Stop;
    8284      (e.str e.buf) (<Apply s.func e.args>);
    83       <Store stream (e.str e.buf) (s.func e.args)> = $fail;
     85      (e.str e.buf) () Stop;
    8486    } :: (e.str) (e.buf) e.stop?,
    8587    e.stop? : Stop =
     
    9092
    9193
    92 *** $func? Get-Line stream = expr;
     94*** $func Get-Line stream = expr;
    9395
    9496Get-Line stream = <Middle 0 1 <Get-Delim stream '\n'>>;
Note: See TracChangeset for help on using the changeset viewer.