Changeset 4016


Ignore:
Timestamp:
Oct 31, 2008, 2:06:12 AM (12 years ago)
Author:
orlov
Message:
  • Serialize.Main function serializes input file to the output file term by term.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • to-imperative/trunk/java/refal/refal/plus/Serialize.rf

    r4015 r4016  
    11$module "refal.plus.Serialize";
    22
    3 $use Box StdIO;
     3$use Box Convert StdIO System;
    44
    55$public $func FileOutputStream s.fileName = s.stream;
     
    2929$func Main = e;
    3030Main =
    31   <ObjectOutputStream <FileOutputStream "x">> :: s.out,
    32   <Write s.out <Box 12 () (-3) (A B 'A' ('B'))>>,
    33   <CloseOutputStream s.out>,
    34   <ObjectInputStream <FileInputStream "x">> :: s.in,
    35   <Read s.in> :: s.box,
    36   <WriteLn s.box>,
    37   <WriteLn <Get s.box>>,
    38   <CloseInputStream s.in>;
     31  {
     32    <Arg 1> : v.inFile, <Arg 2> : v.outFile =
     33      <Channel> :: s.in,
     34      <OpenFile s.in v.inFile R>,
     35      <ObjectOutputStream <FileOutputStream <ToWord v.outFile>>> :: s.out,
     36      $iter, {
     37        <Write s.out <Box <ReadCh s.in>>> = $fail;;
     38      } =
     39      <CloseOutputStream s.out>;
     40    = <PrintLn "Usage: " <Arg 0> " INPUT-FILE OUTPUT-FILE">;
     41  };
Note: See TracChangeset for help on using the changeset viewer.