Changeset 4040
- Timestamp:
- Dec 4, 2008, 11:33:05 AM (12 years ago)
- Location:
- to-imperative/trunk/java/java
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
to-imperative/trunk/java/java/org/refal/plus/Expr.java
r4013 r4040 22 22 public static int right_copy = 0; 23 23 public static int both_copy = 0; 24 25 private static final InplaceConcatenator concatenator = new InplaceConcatenator();26 24 27 25 private final Comparable<?>[] terms; … … 248 246 } 249 247 both_copy++; 250 return concatenator.reinit(len).toRight(expr1).toRight(expr2).yield();248 return getConcatenator(len).toRight(expr1).toRight(expr2).yield(); 251 249 } 252 250 … … 280 278 } 281 279 both_copy++; 282 return concatenator.reinit(expr.length + 1).toRight(expr).toRight(obj).yield();280 return getConcatenator(expr.length + 1).toRight(expr).toRight(obj).yield(); 283 281 } 284 282 … … 301 299 } 302 300 both_copy++; 303 return concatenator.reinit(expr.length + 1).toRight(obj).toRight(expr).yield();301 return getConcatenator(expr.length + 1).toRight(obj).toRight(expr).yield(); 304 302 } 305 303 … … 320 318 assert seq != null : "seq=" + seq; 321 319 int len = seq.length(); 322 Expr.Concatenator ec = concatenator.reinit(len);320 Expr.Concatenator ec = getConcatenator(len); 323 321 for (int i = 0; i < len; i++) 324 322 ec.toRight(seq.charAt(i)); … … 604 602 private int length; 605 603 606 private InplaceConcatenator reinit (int initialCapacity) {607 terms = new Comparable[initialCapacity * 2 + 4];608 length = 0;609 return this;610 }611 612 private InplaceConcatenator () {613 terms = null;614 length = 0;615 }616 617 604 public InplaceConcatenator (int initialCapacity) { 618 605 assert initialCapacity >= 0; -
to-imperative/trunk/java/java/refal/plus/Arithm.java
r3725 r4040 58 58 rem.assign(Util.getBigInteger(int1).remainder(Util.getBigInteger(int2))); 59 59 } catch (ArithmeticException e) { 60 throw new RefalException("Arithm", " Div", "Divide by zero");60 throw new RefalException("Arithm", "Rem", "Divide by zero"); 61 61 } catch (ClassCastException e) { 62 62 throw new RefalException("Arithm", "Rem", "Invalid argument"); … … 94 94 res.assign(Util.getBigInteger(int1).abs()); 95 95 } catch (ClassCastException e) { 96 throw new RefalException("Arithm", " Gcd", "Invalid argument");96 throw new RefalException("Arithm", "Abs", "Invalid argument"); 97 97 } 98 98 }
Note: See TracChangeset
for help on using the changeset viewer.