Changeset 3746


Ignore:
Timestamp:
Apr 20, 2008, 2:35:18 PM (13 years ago)
Author:
yura
Message:
Location:
to-imperative/trunk/java
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • to-imperative/trunk/java/java/org/refal/plus/Symbol.java

    r3745 r3746  
    99    private Symbol () {}
    1010
    11     public static final Comparable<?> nullTerm = new Reference(null);
     11    public static Expr nullExpr = Expr.create(new Reference(null));
    1212
    1313    public static Comparable<?> newInt (String str) {
  • to-imperative/trunk/java/java/refal/plus/Apply.java

    r3725 r3746  
    1515
    1616    @SuppressWarnings("all")
    17     @RefalFormat("$func? Apply s.Name e.Exp = e.Exp;")
     17    @RefalFormat("$func? Apply s.func e.arg = e.res;")
    1818    public static boolean Apply (Expr func, Expr arg, Result res) throws RefalException {
    1919        try {
  • to-imperative/trunk/java/java/refal/plus/Bit.java

    r3725 r3746  
    8585    }
    8686
    87     @RefalFormat("$func BitSet s.int s.pos = s.int;")
    88     public static void BitSet (Expr int1, Expr pos, Result res) throws RefalException {
     87    @RefalFormat("$func BitSet s.int s.index = s.int;")
     88    public static void BitSet (Expr int1, Expr index, Result res) throws RefalException {
    8989        try {
    90             res.assign(Util.getBigInteger(int1).setBit(Util.uintValue(pos)));
     90            res.assign(Util.getBigInteger(int1).setBit(Util.uintValue(index)));
    9191        } catch (ValueOutOfBoundsException _) {
    9292            throw new RefalException("Bit", "BitSet", "Invalid argument");
     
    9696    }
    9797
    98     @RefalFormat("$func BitClear s.int s.pos = s.int;")
    99     public static void BitClear (Expr int1, Expr pos, Result res) throws RefalException {
     98    @RefalFormat("$func BitClear s.int s.index = s.int;")
     99    public static void BitClear (Expr int1, Expr index, Result res) throws RefalException {
    100100        try {
    101             res.assign(Util.getBigInteger(int1).clearBit(Util.uintValue(pos)));
     101            res.assign(Util.getBigInteger(int1).clearBit(Util.uintValue(index)));
    102102        } catch (ValueOutOfBoundsException _) {
    103103            throw new RefalException("Bit", "BitClear", "Invalid argument");
     
    107107    }
    108108
    109     @RefalFormat("$func BitLength s.int = s.len;")
    110     public static void BitLength (Expr int1, Result len) throws RefalException {
     109    @RefalFormat("$func BitLength s.int = s.length;")
     110    public static void BitLength (Expr int1, Result length) throws RefalException {
    111111        try {
    112             len.assign(BigInteger.valueOf(Util.getBigInteger(int1).bitLength()));
     112            length.assign(BigInteger.valueOf(Util.getBigInteger(int1).bitLength()));
    113113        } catch (ClassCastException _) {
    114114            throw new RefalException("Bit", "BitLength", "Invalid argument");
  • to-imperative/trunk/java/java/refal/plus/Compare.java

    r3745 r3746  
    1717    /** @return: '&lt;', '&gt;', '=' */
    1818    @SuppressWarnings("all")
    19     @RefalFormat("$func Compare (e.Exp1) (e.Exp2) = s.Res;")
    20     public static void Compare (Expr a, Expr b, Result res) {
    21         int r = a.compareTo(b);
     19    @RefalFormat("$func Compare (e.exp1) (e.exp2) = s.res;")
     20    public static void Compare (Expr expr1, Expr expr2, Result res) {
     21        int r = expr1.compareTo(expr2);
    2222        if (r > 0)
    2323            res.assign(gt);
     
    2828    }
    2929
    30     @RefalFormat("$func? Eq (e.Exp1) (e.Exp2) = ;")
    31     public static boolean Eq (Expr a, Expr b) {
    32         return a.compareTo(b) == 0;
     30    @RefalFormat("$func? Eq (e.exp1) (e.exp2) = ;")
     31    public static boolean Eq (Expr expr1, Expr expr2) {
     32        return expr1.compareTo(expr2) == 0;
    3333    }
    3434
    35     @RefalFormat("$func? Lt (e.Exp1) (e.Exp2) = ;")
    36     public static boolean Lt (Expr a, Expr b) {
    37         return a.compareTo(b) < 0;
     35    @RefalFormat("$func? Lt (e.exp1) (e.exp2) = ;")
     36    public static boolean Lt (Expr expr1, Expr expr2) {
     37        return expr1.compareTo(expr2) < 0;
    3838    }
    3939
    40     @RefalFormat("$func? Gt (e.Exp1) (e.Exp2) = ;")
    41     public static boolean Gt (Expr a, Expr b) {
    42         return a.compareTo(b) > 0;
     40    @RefalFormat("$func? Gt (e.exp1) (e.exp2) = ;")
     41    public static boolean Gt (Expr expr1, Expr expr2) {
     42        return expr1.compareTo(expr2) > 0;
    4343    }
    4444
    45     @RefalFormat("$func? Ne (e.Exp1) (e.Exp2) = ;")
    46     public static boolean Ne (Expr a, Expr b) {
    47         return a.compareTo(b) != 0;
     45    @RefalFormat("$func? Ne (e.exp1) (e.exp2) = ;")
     46    public static boolean Ne (Expr expr1, Expr expr2) {
     47        return expr1.compareTo(expr2) != 0;
    4848    }
    4949
    50     @RefalFormat("$func? Le (e.Exp1) (e.Exp2) = ;")
    51     public static boolean Le (Expr a, Expr b) {
    52         return a.compareTo(b) <= 0;
     50    @RefalFormat("$func? Le (e.exp1) (e.exp2) = ;")
     51    public static boolean Le (Expr expr1, Expr expr2) {
     52        return expr1.compareTo(expr2) <= 0;
    5353    }
    5454
    55     @RefalFormat("$func? Ge (e.Exp1) (e.Exp2) = ;")
    56     public static boolean Ge (Expr a, Expr b) {
    57         return a.compareTo(b) >= 0;
     55    @RefalFormat("$func? Ge (e.exp1) (e.exp2) = ;")
     56    public static boolean Ge (Expr expr1, Expr expr2) {
     57        return expr1.compareTo(expr2) >= 0;
    5858    }
    5959}
  • to-imperative/trunk/java/java/refal/plus/Dir.java

    r3721 r3746  
    2626    }
    2727
    28     @RefalFormat("$func OpenDir e.dirname = s.dir;")
    29     public static void OpenDir (Expr name, Result dir) throws RefalException {
    30         dir.assign(new Dir(name.toChars().toString()));
     28    @RefalFormat("$func OpenDir e.dirName = s.dir;")
     29    public static void OpenDir (Expr dirName, Result dir) throws RefalException {
     30        dir.assign(new Dir(dirName.toChars().toString()));
    3131    }
    3232
    33     @RefalFormat("$func? ReadDir s.dir = e.filename;")
    34     public static boolean ReadDir (Expr dir, Result fname) throws RefalException {
     33    @RefalFormat("$func? ReadDir s.dir = e.file;")
     34    public static boolean ReadDir (Expr dir, Result file) throws RefalException {
    3535        assert dir.length() == 1;
    3636        try {
    3737            Dir d = (Dir) dir.at(0);
    3838            if (d.files != null && d.pointer < d.files.length) {
    39                 fname.assign(Expr.fromSequence(d.files[d.pointer++]));
     39                file.assign(Expr.fromSequence(d.files[d.pointer++]));
    4040                return true;
    4141            }
  • to-imperative/trunk/java/java/refal/plus/Dos.java

    r3745 r3746  
    2323    private static final Character point = new Character('.');
    2424
    25     @RefalFormat("$func Time = e.string;")
    26     public static void Time (Result string) {
     25    @RefalFormat("$func Time = e.time;")
     26    public static void Time (Result time) {
    2727        Calendar cal = Calendar.getInstance();
    28         string.assign(Expr.getConcatenator(13).toRight(BigInteger.valueOf(cal.get(Calendar.DAY_OF_MONTH))).toRight(
     28        time.assign(Expr.getConcatenator(13).toRight(BigInteger.valueOf(cal.get(Calendar.DAY_OF_MONTH))).toRight(
    2929                space).toRight(months[cal.get(Calendar.MONTH)]).toRight(space).toRight(
    3030                BigInteger.valueOf(cal.get(Calendar.YEAR))).toRight(space).toRight(cal.get(Calendar.HOUR_OF_DAY))
  • to-imperative/trunk/java/java/refal/plus/File.java

    r3729 r3746  
    2828    }
    2929
    30     @RefalFormat("$func? Exists e.fname = ;")
    31     public static boolean Exists (Expr name) throws RefalException {
     30    @RefalFormat("$func? Exists e.file = ;")
     31    public static boolean Exists (Expr file) throws RefalException {
    3232        try {
    33             return (new java.io.File(name.toChars().toString())).exists();
     33            return (new java.io.File(file.toChars().toString())).exists();
    3434        } catch (SecurityException _) {
    3535            throw new RefalException("File", "Exists", "Access denied");
     
    3737    }
    3838
    39     @RefalFormat("$func? CanRead e.fname = ;")
    40     public static boolean CanRead (Expr name) throws RefalException {
     39    @RefalFormat("$func? CanRead e.file = ;")
     40    public static boolean CanRead (Expr file) throws RefalException {
    4141        try {
    42             return (new java.io.File(name.toChars().toString())).canRead();
     42            return (new java.io.File(file.toChars().toString())).canRead();
    4343        } catch (SecurityException _) {
    4444            throw new RefalException("File", "CanRead", "Access denied");
     
    4646    }
    4747
    48     @RefalFormat("$func? CanWrite e.fname = ;")
    49     public static boolean CanWrite (Expr name) throws RefalException {
     48    @RefalFormat("$func? CanWrite e.file = ;")
     49    public static boolean CanWrite (Expr file) throws RefalException {
    5050        try {
    51             return (new java.io.File(name.toChars().toString())).canWrite();
     51            return (new java.io.File(file.toChars().toString())).canWrite();
    5252        } catch (SecurityException _) {
    5353            throw new RefalException("File", "CanWrite", "Access denied");
     
    5555    }
    5656
    57     @RefalFormat("$func? CanExec e.fname = ;")
    58     public static boolean CanExec (Expr name) throws RefalException {
     57    @RefalFormat("$func? CanExec e.file = ;")
     58    public static boolean CanExec (Expr file) throws RefalException {
    5959        // FIXME (sometime): in Java 6 there is a method File.canExecute().
    6060        // Meanwhile just check that the file exists.
    6161        try {
    62             java.lang.String s = name.toChars().toString();
    63             if (!(new java.io.File(s)).exists())
     62            java.lang.String str = file.toChars().toString();
     63            if (!(new java.io.File(str)).exists())
    6464                return false;
    6565            SecurityManager sm = java.lang.System.getSecurityManager();
    6666            if (sm != null)
    67                 sm.checkExec(s);
     67                sm.checkExec(str);
    6868            return true;
    6969        } catch (SecurityException _) {
     
    7272    }
    7373
    74     @RefalFormat("$func? IsDirectory e.fname = ;")
    75     public static boolean IsDirectory (Expr name) throws RefalException {
     74    @RefalFormat("$func? IsDirectory e.file = ;")
     75    public static boolean IsDirectory (Expr file) throws RefalException {
    7676        try {
    77             return (new java.io.File(name.toChars().toString())).isDirectory();
     77            return (new java.io.File(file.toChars().toString())).isDirectory();
    7878        } catch (SecurityException _) {
    7979            throw new RefalException("File", "IsDirectory", "Access denied");
     
    8181    }
    8282
    83     @RefalFormat("$func? IsFile e.fname = ;")
    84     public static boolean IsFile (Expr name) throws RefalException {
     83    @RefalFormat("$func? IsFile e.file = ;")
     84    public static boolean IsFile (Expr file) throws RefalException {
    8585        try {
    86             return (new java.io.File(name.toChars().toString())).isFile();
     86            return (new java.io.File(file.toChars().toString())).isFile();
    8787        } catch (SecurityException _) {
    8888            throw new RefalException("File", "IsFile", "Access denied");
     
    9090    }
    9191
    92     @RefalFormat("$func? Delete e.fname = ;")
    93     public static boolean Delete (Expr name) throws RefalException {
     92    @RefalFormat("$func? Delete e.file = ;")
     93    public static boolean Delete (Expr file) throws RefalException {
    9494        try {
    95             return (new java.io.File(name.toChars().toString())).delete();
     95            return (new java.io.File(file.toChars().toString())).delete();
    9696        } catch (SecurityException _) {
    9797            throw new RefalException("File", "Delete", "Access denied");
     
    9999    }
    100100
    101     @RefalFormat("$func LastModified e.fname = s.int;")
    102     public static void LastModified (Expr name, Result res) throws RefalException {
     101    @RefalFormat("$func LastModified e.file = s.time;")
     102    public static void LastModified (Expr file, Result time) throws RefalException {
    103103        try {
    104             res.assign(BigInteger.valueOf(new java.io.File(name.toChars().toString()).lastModified()));
     104            time.assign(BigInteger.valueOf(new java.io.File(file.toChars().toString()).lastModified()));
    105105        } catch (SecurityException _) {
    106106            throw new RefalException("File", "LastModified", "Access denied");
  • to-imperative/trunk/java/java/refal/plus/Java.java

    r3729 r3746  
    33package refal.plus;
    44
    5 import org.refal.plus.Expr;
    65import org.refal.plus.RefalFormat;
    76import org.refal.plus.Result;
     
    1211    private Java () {}
    1312
    14     private static Expr nullExpr = Expr.create(Symbol.nullTerm);
    15 
    16     @RefalFormat("$func Null = s;")
    17     public static void Null (Result res) {
    18         res.assign(nullExpr);
     13    @RefalFormat("$func Null = s.null;")
     14    public static void Null (Result n) {
     15        n.assign(Symbol.nullExpr);
    1916    }
    2017}
  • to-imperative/trunk/java/java/refal/plus/StdIO.java

    r3729 r3746  
    7070    }
    7171
    72     @RefalFormat("$func? PrimRead s.channel s.n = e.chars;")
    73     public static boolean PrimRead (Expr channel, Expr len, Result chars) throws RefalException {
     72    @RefalFormat("$func? PrimRead s.channel s.length = e.chars;")
     73    public static boolean PrimRead (Expr channel, Expr length, Result chars) throws RefalException {
    7474        try {
    7575            // int n = Util.uintValue(len);
    76             int n = ((BigInteger) len.at(0)).intValue();
     76            int n = ((BigInteger) length.at(0)).intValue();
    7777            char[] buf = new char[n];
    7878            n = getChannel(channel).read(buf, 0, n);
     
    9090    }
    9191
    92     @RefalFormat("$func Write e.Expr = ;")
    93     public static void Write (Expr e) {
    94         java.lang.System.out.print(e.toString());
    95     }
    96 
    97     @RefalFormat("$func WriteLn e.Expr = ;")
    98     public static void WriteLn (Expr e) {
    99         java.lang.System.out.println(e.toString());
    100     }
    101 
    102     @RefalFormat("$func WriteCh s.Channel e.Expr = ;")
    103     public static void WriteCh (Expr channel, Expr e) throws RefalException {
    104         try {
    105             getChannel(channel).print(e.toString());
     92    @RefalFormat("$func Write e.expr = ;")
     93    public static void Write (Expr expr) {
     94        java.lang.System.out.print(expr.toString());
     95    }
     96
     97    @RefalFormat("$func WriteLn e.expr = ;")
     98    public static void WriteLn (Expr expr) {
     99        java.lang.System.out.println(expr.toString());
     100    }
     101
     102    @RefalFormat("$func WriteCh s.channel e.expr = ;")
     103    public static void WriteCh (Expr channel, Expr expr) throws RefalException {
     104        try {
     105            getChannel(channel).print(expr.toString());
    106106        } catch (ClassCastException _) {
    107107            throw new RefalException("StdIO", "WriteCh", "Invalid argument");
     
    112112    }
    113113
    114     @RefalFormat("$func WriteLnCh s.Channel e.Expr = ;")
    115     public static void WriteLnCh (Expr channel, Expr e) throws RefalException {
    116         try {
    117             getChannel(channel).println(e.toString());
     114    @RefalFormat("$func WriteLnCh s.channel e.expr = ;")
     115    public static void WriteLnCh (Expr channel, Expr expr) throws RefalException {
     116        try {
     117            getChannel(channel).println(expr.toString());
    118118        } catch (ClassCastException _) {
    119119            throw new RefalException("StdIO", "WriteLnCh", "Invalid argument");
     
    124124    }
    125125
    126     @RefalFormat("$func Print e.Expr = ;")
    127     public static void Print (Expr e) {
    128         java.lang.System.out.print(e.toChars());
    129     }
    130 
    131     @RefalFormat("$func PrintLn e.Expr = ;")
    132     public static void PrintLn (Expr e) {
    133         java.lang.System.out.println(e.toChars());
    134     }
    135 
    136     @RefalFormat("$func PrintCh s.Channel e.Expr = ;")
    137     public static void PrintCh (Expr channel, Expr e) throws RefalException {
    138         try {
    139             getChannel(channel).print(e.toChars());
     126    @RefalFormat("$func Print e.expr = ;")
     127    public static void Print (Expr expr) {
     128        java.lang.System.out.print(expr.toChars());
     129    }
     130
     131    @RefalFormat("$func PrintLn e.expr = ;")
     132    public static void PrintLn (Expr expr) {
     133        java.lang.System.out.println(expr.toChars());
     134    }
     135
     136    @RefalFormat("$func PrintCh s.channel e.expr = ;")
     137    public static void PrintCh (Expr channel, Expr expr) throws RefalException {
     138        try {
     139            getChannel(channel).print(expr.toChars());
    140140        } catch (ClassCastException _) {
    141141            throw new RefalException("StdIO", "PrintCh", "Invalid argument");
     
    146146    }
    147147
    148     @RefalFormat("$func PrintLnCh s.Channel e.Expr = ;")
    149     public static void PrintLnCh (Expr channel, Expr e) throws RefalException {
    150         try {
    151             getChannel(channel).println(e.toChars());
     148    @RefalFormat("$func PrintLnCh s.channel e.expr = ;")
     149    public static void PrintLnCh (Expr channel, Expr expr) throws RefalException {
     150        try {
     151            getChannel(channel).println(expr.toChars());
    152152        } catch (ClassCastException _) {
    153153            throw new RefalException("StdIO", "PrintLnCh", "Invalid argument");
     
    183183    static final Expr Buffers = refal.plus.internal.StdIO.Buffers;
    184184
    185     @RefalFormat("$func? OpenFile s e s = ;")
    186     public static boolean OpenFile (Expr _vs_channel, Expr _ve_file, Expr _vs_mode) throws RefalException {
    187         return refal.plus.internal.StdIO.OpenFile(_vs_channel, _ve_file, _vs_mode);
    188     }
    189 
    190     @RefalFormat("$func CloseChannel s = ;")
    191     public static void CloseChannel (Expr _vs_channel) throws RefalException {
    192         refal.plus.internal.StdIO.CloseChannel(_vs_channel);
    193     }
    194 
    195     @RefalFormat("$func? IsEof s = ;")
    196     public static boolean IsEof (Expr _vs_channel) throws RefalException {
    197         return refal.plus.internal.StdIO.IsEof(_vs_channel);
    198     }
    199 
    200     @RefalFormat("$func? ReadCharCh s = s;")
    201     public static boolean ReadCharCh (Expr _vs_channel, Result _v_res1) throws RefalException {
    202         return refal.plus.internal.StdIO.ReadCharCh(_vs_channel, _v_res1);
    203     }
    204 
    205     @RefalFormat("$func? ReadChar = s;")
    206     public static boolean ReadChar (Result _v_res1) throws RefalException {
    207         return refal.plus.internal.StdIO.ReadChar(_v_res1);
    208     }
    209 
    210     @RefalFormat("$func? ReadLineCh s = e;")
    211     public static boolean ReadLineCh (Expr _vs_channel, Result _v_res1) throws RefalException {
    212         return refal.plus.internal.StdIO.ReadLineCh(_vs_channel, _v_res1);
    213     }
    214 
    215     @RefalFormat("$func? ReadLine = e;")
    216     public static boolean ReadLine (Result _v_res1) throws RefalException {
    217         return refal.plus.internal.StdIO.ReadLine(_v_res1);
    218     }
    219 
    220     @RefalFormat("$func? ReadCh s = t;")
    221     public static boolean ReadCh (Expr _vs_channel, Result _v_res1) throws RefalException {
    222         return refal.plus.internal.StdIO.ReadCh(_vs_channel, _v_res1);
    223     }
    224 
    225     @RefalFormat("$func? Read = t;")
    226     public static boolean Read (Result _v_res1) throws RefalException {
    227         return refal.plus.internal.StdIO.Read(_v_res1);
     185    @RefalFormat("$func? OpenFile s.channel e.file s.mode = ;")
     186    public static boolean OpenFile (Expr channel, Expr file, Expr mode) throws RefalException {
     187        return refal.plus.internal.StdIO.OpenFile(channel, file, mode);
     188    }
     189
     190    @RefalFormat("$func CloseChannel s.channel = ;")
     191    public static void CloseChannel (Expr channel) throws RefalException {
     192        refal.plus.internal.StdIO.CloseChannel(channel);
     193    }
     194
     195    @RefalFormat("$func? IsEof s.channel = ;")
     196    public static boolean IsEof (Expr channel) throws RefalException {
     197        return refal.plus.internal.StdIO.IsEof(channel);
     198    }
     199
     200    @RefalFormat("$func? ReadCharCh s.channel = s.char;")
     201    public static boolean ReadCharCh (Expr channel, Result ch) throws RefalException {
     202        return refal.plus.internal.StdIO.ReadCharCh(channel, ch);
     203    }
     204
     205    @RefalFormat("$func? ReadChar = s.char;")
     206    public static boolean ReadChar (Result ch) throws RefalException {
     207        return refal.plus.internal.StdIO.ReadChar(ch);
     208    }
     209
     210    @RefalFormat("$func? ReadLineCh s.channel = e.chars;")
     211    public static boolean ReadLineCh (Expr channel, Result chars) throws RefalException {
     212        return refal.plus.internal.StdIO.ReadLineCh(channel, chars);
     213    }
     214
     215    @RefalFormat("$func? ReadLine = e.chars;")
     216    public static boolean ReadLine (Result chars) throws RefalException {
     217        return refal.plus.internal.StdIO.ReadLine(chars);
     218    }
     219
     220    @RefalFormat("$func? ReadCh s.channel = t.term;")
     221    public static boolean ReadCh (Expr channel, Result term) throws RefalException {
     222        return refal.plus.internal.StdIO.ReadCh(channel, term);
     223    }
     224
     225    @RefalFormat("$func? Read = t.term;")
     226    public static boolean Read (Result term) throws RefalException {
     227        return refal.plus.internal.StdIO.Read(term);
    228228    }
    229229
  • to-imperative/trunk/java/java/refal/plus/System.java

    r3721 r3746  
    3838
    3939    @SuppressWarnings("all")
    40     @RefalFormat("$func System e.cmd = s.res ;")
    41     public static void System (Expr cmd, Result res) throws RefalException {
     40    @RefalFormat("$func System e.command = s.returnCode;")
     41    public static void System (Expr command, Result returnCode) throws RefalException {
    4242        try {
    43             Process p = Runtime.getRuntime().exec(cmd.toChars().toString());
     43            Process p = Runtime.getRuntime().exec(command.toChars().toString());
    4444            new Thread(new CmdOutputCatcher(p.getInputStream())).start();
    4545            new Thread(new CmdOutputCatcher(p.getErrorStream())).start();
    46             res.assign(BigInteger.valueOf(p.waitFor()));
     46            returnCode.assign(BigInteger.valueOf(p.waitFor()));
    4747            Thread.yield();
    4848        } catch (InterruptedException e) {
  • to-imperative/trunk/java/java/refal/plus/Vector.java

    r3745 r3746  
    4141    }
    4242
    43     @RefalFormat("$func VectorInit s.vector s.lenght e.fill = ;")
    44     public static void VectorInit (Expr vector, Expr lenght, Expr fill) throws RefalException {
     43    @RefalFormat("$func VectorInit s.vector s.lenght e.expr = ;")
     44    public static void VectorInit (Expr vector, Expr lenght, Expr expr) throws RefalException {
    4545        try {
    4646            org.refal.plus.objects.Vector vec = getVector(vector);
     
    4848            vec.clear();
    4949            for (int i = 0; i < s; i++)
    50                 vec.add(fill);
     50                vec.add(expr);
    5151        } catch (NegativeValueException _) {
    5252            throw new RefalException("Vector", "VectorInit", "Invalid argument");
     
    5858    }
    5959
    60     @RefalFormat("$func VectorFill s.vector e.fill = ;")
    61     public static void VectorFill (Expr vector, Expr fill) throws RefalException {
     60    @RefalFormat("$func VectorFill s.vector e.expr = ;")
     61    public static void VectorFill (Expr vector, Expr expr) throws RefalException {
    6262        try {
    6363            org.refal.plus.objects.Vector vec = getVector(vector);
    6464            int s = vec.size();
    6565            for (int i = 0; i < s; i++)
    66                 vec.set(i, fill);
     66                vec.set(i, expr);
    6767        } catch (ClassCastException _) {
    6868            throw new RefalException("Vector", "VectorFill", "Invalid argument");
     
    120120    }
    121121
    122     @RefalFormat("$func Subvector s.vector s.index s.length = s.subVector;")
    123     public static void Subvector (Expr vector, Expr index, Expr length, Result subVector) throws RefalException {
     122    @RefalFormat("$func Subvector s.vector s.index s.length = s.subvector;")
     123    public static void Subvector (Expr vector, Expr index, Expr length, Result subvector) throws RefalException {
    124124        try {
    125125            int s = Util.uintValue(index);
    126126            int e = s + Util.uintValue(length);
    127             Symbol.setObject(getVector(vector).subVector(s, e), subVector);
     127            Symbol.setObject(getVector(vector).subVector(s, e), subvector);
    128128        } catch (NegativeValueException _) {
    129129            throw new RefalException("Vector", "Subvector", "Invalid argument");
     
    137137    }
    138138
    139     @RefalFormat("$func SubvectorFill s.vector s.index s.length e.fill = ;")
    140     public static void SubvectorFill (Expr vector, Expr index, Expr length, Expr fill) throws RefalException {
     139    @RefalFormat("$func SubvectorFill s.vector s.index s.length e.expr = ;")
     140    public static void SubvectorFill (Expr vector, Expr index, Expr length, Expr expr) throws RefalException {
    141141        try {
    142142            org.refal.plus.objects.Vector vec = getVector(vector);
     
    144144            int e = s + Util.uintValue(length);
    145145            for (int i = s; i < e; i++)
    146                 vec.set(i, fill);
     146                vec.set(i, expr);
    147147        } catch (NegativeValueException _) {
    148148            throw new RefalException("Vector", "SubvectorFill", "Invalid argument");
  • to-imperative/trunk/java/refal/refal/plus/internal/StdIO.rfi

    r3659 r3746  
    1212
    1313//$func  Channel      = s.Channel;
    14 $func? OpenFile     s.Channel e.FileName s.Mode = ;
    15 $func  CloseChannel s.Channel = ;
     14$func? OpenFile     s.channel e.file s.mode = ;
     15$func  CloseChannel s.channel = ;
    1616
    1717//$func ParseFileName e.FileName = s.DriveWord s.PathWord s.NameWord s.ExtWord;
    1818//$func? EraseFile    e.FileName = ;
    1919
    20 $func? IsEof        s.Channel = ;
     20$func? IsEof        s.channel = ;
    2121
    22 $func? Read     = t.Term;
    23 $func? ReadChar = s.Char;
    24 $func? ReadLine = e.Char;
     22$func? Read     = t.term;
     23$func? ReadChar = s.char;
     24$func? ReadLine = e.chars;
    2525//$func  Write   e.Expr = ;
    2626//$func  WriteLn e.Expr = ;
     
    2828//$func  PrintLn e.Expr = ;
    2929
    30 $func? ReadCh     s.Channel = t.Term;
    31 $func? ReadCharCh s.Channel = s.Char;
    32 $func? ReadLineCh s.Channel = e.Char;
     30$func? ReadCh     s.channel = t.term;
     31$func? ReadCharCh s.channel = s.char;
     32$func? ReadLineCh s.channel = e.chars;
    3333//$func  WriteCh    s.Channel e.Expr = ;
    3434//$func  WriteLnCh  s.Channel e.Expr = ;
Note: See TracChangeset for help on using the changeset viewer.