Changeset 2117


Ignore:
Timestamp:
Sep 29, 2006, 8:35:28 PM (14 years ago)
Author:
roman
Message:

Project files for VS
Fixed problems with J#:

Location:
to-imperative/branches/j-sharp/org/refal/plus
Files:
2 added
11 edited

Legend:

Unmodified
Added
Removed
  • to-imperative/branches/j-sharp/org/refal/plus/Util.java

    r2114 r2117  
    1616    }
    1717
    18     static final BigInteger bigZero = BigInteger.valueOf(0);
    19 
    2018    public static boolean fitsNonnegativeInteger (BigInteger i)
    2119    {
    22         return i.compareTo(bigZero) >= 0 && i.compareTo(maxInt) <= 0;
     20                return i.compareTo(BigInteger.valueOf(0)) >= 0 && i.compareTo(maxInt) <= 0;
    2321    }
    2422}
  • to-imperative/branches/j-sharp/org/refal/plus/library/Access.java

    r2024 r2117  
    1212    static private int intValue (BigInteger i) throws ValueOutOfBoundsException
    1313    {
    14         if (i.compareTo(BigInteger.ZERO) < 0 || i.compareTo(Util.maxInt) > 0)
     14        if (i.compareTo(BigInteger.valueOf(0)) < 0 || i.compareTo(Util.maxInt) > 0)
    1515            throw new ValueOutOfBoundsException();
    1616        return i.intValue();
     
    2020        throws RefalException
    2121    {
    22         assert s_left.getLen() == 1;
     22        //assert s_left.getLen() == 1;
    2323        try {
    2424            int left = intValue((BigInteger) s_left.at(0));
     
    3636        throws RefalException
    3737    {
    38         assert s_right.getLen() == 1;
     38        //assert s_right.getLen() == 1;
    3939        try {
    4040            int right = intValue((BigInteger) s_right.at(0));
     
    5252        throws RefalException
    5353    {
    54         assert s_left.getLen() == 1;
    55         assert s_len.getLen() == 1;
     54        //assert s_left.getLen() == 1;
     55        //assert s_len.getLen() == 1;
    5656        try {
    5757            int len  = intValue((BigInteger) s_len .at(0));
     
    7070        throws RefalException
    7171    {
    72         assert s_right.getLen() == 1;
    73         assert s_len.getLen() == 1;
     72        //assert s_right.getLen() == 1;
     73        //assert s_len.getLen() == 1;
    7474        try {
    7575            int len   = intValue((BigInteger) s_len  .at(0));
     
    8888        throws RefalException
    8989    {
    90         assert s_left.getLen() == 1;
    91         assert s_right.getLen() == 1;
     90        //assert s_left.getLen() == 1;
     91        //assert s_right.getLen() == 1;
    9292        try {
    9393            int left  = intValue((BigInteger) s_left .at(0));
  • to-imperative/branches/j-sharp/org/refal/plus/library/Apply.java

    r2024 r2117  
    1212        throws RefalException
    1313    {
    14         assert func.getLen() == 1;
     14        //assert func.getLen() == 1;
    1515        try {
    1616            return ((Func)func.at(0)).eval(arg, res);
  • to-imperative/branches/j-sharp/org/refal/plus/library/Arithm.java

    r2059 r2117  
    1212    static public void _p_ (Expr s1, Expr s2, Result res) throws RefalException
    1313    {
    14         assert s1.getLen() == 1;
    15         assert s2.getLen() == 1;
     14        //assert s1.getLen() == 1;
     15        //assert s2.getLen() == 1;
    1616        try {
    1717            res.assign(((BigInteger) s1.at(0)).add((BigInteger) s2.at(0)));
     
    2323    static public void _m_ (Expr s1, Expr s2, Result res) throws RefalException
    2424    {
    25         assert s1.getLen() == 1;
    26         assert s2.getLen() == 1;
     25        //assert s1.getLen() == 1;
     26        //assert s2.getLen() == 1;
    2727        try {
    2828            res.assign(((BigInteger) s1.at(0)).subtract((BigInteger) s2.at(0)));
     
    3434    static public void _a_ (Expr s1, Expr s2, Result res) throws RefalException
    3535    {
    36         assert s1.getLen() == 1;
    37         assert s2.getLen() == 1;
     36        //assert s1.getLen() == 1;
     37        //assert s2.getLen() == 1;
    3838        try {
    3939            res.assign(((BigInteger) s1.at(0)).multiply((BigInteger) s2.at(0)));
     
    4545    static public void Div (Expr s1, Expr s2, Result res) throws RefalException
    4646    {
    47         assert s1.getLen() == 1;
    48         assert s2.getLen() == 1;
     47        //assert s1.getLen() == 1;
     48        //assert s2.getLen() == 1;
    4949        try {
    5050            res.assign(((BigInteger) s1.at(0)).divide((BigInteger) s2.at(0)));
     
    5858    static public void Rem (Expr s1, Expr s2, Result res) throws RefalException
    5959    {
    60         assert s1.getLen() == 1;
    61         assert s2.getLen() == 1;
     60        //assert s1.getLen() == 1;
     61        //assert s2.getLen() == 1;
    6262        try {
    6363            res.assign(((BigInteger) s1.at(0)).remainder((BigInteger) s2.at(0)));
     
    7272        throws RefalException
    7373    {
    74         assert s1.getLen() == 1;
    75         assert s2.getLen() == 1;
     74        //assert s1.getLen() == 1;
     75        //assert s2.getLen() == 1;
    7676        try {
    7777            BigInteger[] a = ((BigInteger) s1.at(0)).divideAndRemainder((BigInteger) s2.at(0));
     
    8787    static public void GCD (Expr s1, Expr s2, Result res) throws RefalException
    8888    {
    89         assert s1.getLen() == 1;
    90         assert s2.getLen() == 1;
     89        //assert s1.getLen() == 1;
     90        //assert s2.getLen() == 1;
    9191        try {
    9292            BigInteger d = ((BigInteger) s1.at(0)).gcd((BigInteger) s2.at(0));
    93             if (d.equals(BigInteger.ZERO))
     93            if (d.equals(BigInteger.valueOf(0)))
    9494                throw new RefalException("Arithm", "GCD", "Zero arguments");
    9595            res.assign(d);
     
    101101    static public void Max (Expr s1, Expr s2, Result res) throws RefalException
    102102    {
    103         assert s1.getLen() == 1;
    104         assert s2.getLen() == 1;
     103        //assert s1.getLen() == 1;
     104        //assert s2.getLen() == 1;
    105105        try {
    106106            res.assign(((BigInteger) s1.at(0)).max((BigInteger) s2.at(0)));
     
    112112    static public void Min (Expr s1, Expr s2, Result res) throws RefalException
    113113    {
    114         assert s1.getLen() == 1;
    115         assert s2.getLen() == 1;
     114        //assert s1.getLen() == 1;
     115        //assert s2.getLen() == 1;
    116116        try {
    117117            res.assign(((BigInteger) s1.at(0)).min((BigInteger) s2.at(0)));
  • to-imperative/branches/j-sharp/org/refal/plus/library/Box.java

    r2024 r2117  
    4545    static public void _q_ (Expr box, Result res) throws RefalException
    4646    {
    47         assert box.getLen() == 1;
     47        //assert box.getLen() == 1;
    4848        try {
    4949            res.assign(((Box) box.at(0)).expr);
     
    5555    static public void Store (Expr box, Expr e) throws RefalException
    5656    {
    57         assert box.getLen() == 1;
     57        //assert box.getLen() == 1;
    5858        try {
    5959            ((Box) box.at(0)).expr = e;
  • to-imperative/branches/j-sharp/org/refal/plus/library/Convert.java

    r2024 r2117  
    1313    static public void To_m_Chars (Expr e, Result res)
    1414    {
    15         res.assign(Expr.fromSequence(e.toStringBuffer()));
     15        res.assign(Expr.fromSequence(e.toString()));
    1616    }
    1717
  • to-imperative/branches/j-sharp/org/refal/plus/library/Dir.java

    r2024 r2117  
    2929    public static boolean Read_m_Dir (Expr dir, Result fname) throws RefalException
    3030    {
    31         assert dir.getLen() == 1;
     31        //assert dir.getLen() == 1;
    3232        try {
    3333            Dir d = (Dir) dir.at(0);
     
    4444    public static void Close_m_Dir (Expr dir) throws RefalException
    4545    {
    46         assert dir.getLen() == 1;
     46        //assert dir.getLen() == 1;
    4747        try {
    4848            ((Dir) dir.at(0)).files = null;
  • to-imperative/branches/j-sharp/org/refal/plus/library/Dos.java

    r2060 r2117  
    4444    static public void Arg (Expr e, Result res) throws RefalException
    4545    {
    46         assert e.getLen() == 1;
     46        //assert e.getLen() == 1;
    4747        try {
    4848            BigInteger i = (BigInteger) e.at(0);
     
    7272    static public void Exit (Expr e) throws RefalException
    7373    {
    74         assert e.getLen() == 1;
     74        //assert e.getLen() == 1;
    7575        try {
    7676            BigInteger i = (BigInteger) e.at(0);
  • to-imperative/branches/j-sharp/org/refal/plus/library/NamedVector.java

    r1846 r2117  
    2424    }
    2525 
    26     public String toString ()
    27     {
    28         return name;
    29     }
     26    //public String toString ()
     27    //{
     28    //    return name;
     29    //}
    3030}
  • to-imperative/branches/j-sharp/org/refal/plus/library/StdIO.java

    r2066 r2117  
    8787    public static void Write_e_ (Expr channel, Expr e) throws RefalException
    8888    {
    89         assert channel.getLen() == 1;
     89        //assert channel.getLen() == 1;
    9090        try {
    9191            ((Channel) channel.at(0)).print(e.formattedRepresentation());
     
    102102    public static void WriteLN_e_ (Expr channel, Expr e) throws RefalException
    103103    {
    104         assert channel.getLen() == 1;
     104        //assert channel.getLen() == 1;
    105105        try {
    106106            ((Channel) channel.at(0)).println(e.formattedRepresentation());
     
    127127    public static void Print_e_ (Expr channel, Expr e) throws RefalException
    128128    {
    129         assert channel.getLen() == 1;
     129        //assert channel.getLen() == 1;
    130130        try {
    131131            ((Channel) channel.at(0)).print(e);
     
    142142    public static void PrintLN_e_ (Expr channel, Expr e) throws RefalException
    143143    {
    144         assert channel.getLen() == 1;
     144        //assert channel.getLen() == 1;
    145145        try {
    146146            ((Channel) channel.at(0)).println(e);
     
    157157    public static void Flush_e_ (Expr channel) throws RefalException
    158158    {
    159         assert channel.getLen() == 1;
     159        //assert channel.getLen() == 1;
    160160        try {
    161161            ((Channel) channel.at(0)).flush();
     
    555555      try {
    556556          Result _v_Stream1 = new Result();
    557           Stream.Stream (_c_3, new Expr(StdIn, new Expr(BigInteger.ONE)), _v_Stream1);
     557          Stream.Stream (_c_3, new Expr(StdIn, new Expr(BigInteger.valueOf(1))), _v_Stream1);
    558558          Table.Bind (Buffers, StdIn, _v_Stream1.getExpr());
    559559      } catch (RefalException _) {}
  • to-imperative/branches/j-sharp/org/refal/plus/library/Table.java

    r2062 r2117  
    2626    static public void Bind (Expr tab, Expr key, Expr val) throws RefalException
    2727    {
    28         assert tab.getLen() == 1;
     28        //assert tab.getLen() == 1;
    2929        try {
    3030            ((TreeMap) tab.at(0)).put(key, val);
     
    3636    static public void Unbind (Expr tab, Expr key) throws RefalException
    3737    {
    38         assert tab.getLen() == 1;
     38        //assert tab.getLen() == 1;
    3939        try {
    4040            ((TreeMap) tab.at(0)).remove(key);
     
    4646    static public boolean Lookup (Expr tab, Expr key, Result val) throws RefalException
    4747    {
    48         assert tab.getLen() == 1;
     48        //assert tab.getLen() == 1;
    4949        try {
    5050            Expr e = (Expr) ((TreeMap) tab.at(0)).get(key);
     
    5959    static public boolean In_m_Table_q_ (Expr tab, Expr key) throws RefalException
    6060    {
    61         assert tab.getLen() == 1;
     61        //assert tab.getLen() == 1;
    6262        try {
    6363            return ((TreeMap) tab.at(0)).containsKey(key);
     
    6969    static public void Domain (Expr tab, Result res) throws RefalException
    7070    {
    71         assert tab.getLen() == 1;
     71        //assert tab.getLen() == 1;
    7272        try {
    7373            res.assign(((TreeMap) tab.at(0)).keySet().toArray());
     
    7979    static public void Values (Expr tab, Result res) throws RefalException
    8080    {
    81         assert tab.getLen() == 1;
     81        //assert tab.getLen() == 1;
    8282        try {
    8383            res.assign(((TreeMap) tab.at(0)).values().toArray());
     
    8989    static public void Entries (Expr tab, Result res) throws RefalException
    9090    {
    91         assert tab.getLen() == 1;
     91        //assert tab.getLen() == 1;
    9292        try {
    9393            TreeMap t = (TreeMap) tab.at(0);
     
    108108    static public void Table_m_Copy (Expr tab, Result res) throws RefalException
    109109    {
    110         assert tab.getLen() == 1;
     110        //assert tab.getLen() == 1;
    111111        try {
    112112            res.assign(((TreeMap) tab.at(0)).clone());
     
    118118    static public void Replace_m_Table (Expr target, Expr source) throws RefalException
    119119    {
    120         assert target.getLen() == 1;
    121         assert source.getLen() == 1;
     120        //assert target.getLen() == 1;
     121        //assert source.getLen() == 1;
    122122        try {
    123123            TreeMap t = (TreeMap) target.at(0);
     
    131131    static public void Clear_m_Table (Expr tab) throws RefalException
    132132    {
    133         assert tab.getLen() == 1;
     133        //assert tab.getLen() == 1;
    134134        try {
    135135            ((TreeMap) tab.at(0)).clear();
     
    141141    static public void Table_m_Size (Expr tab, Result res) throws RefalException
    142142    {
    143         assert tab.getLen() == 1;
     143        //assert tab.getLen() == 1;
    144144        try {
    145145            res.assign(BigInteger.valueOf(((TreeMap) tab.at(0)).size()));
Note: See TracChangeset for help on using the changeset viewer.