<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -8,5 +8,4 @@
   - HbFloat#round (precision?)
 - HbString
   - toNumber (toInt? toFloat?)
-  - succ, pred
 - rand() (seems like it should be static, but that's not possible right now...)</diff>
      <filename>TODO</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,7 @@
 	&lt;property name=&quot;build&quot; location=&quot;bin&quot;/&gt;
 	&lt;target name=&quot;compile&quot;&gt;
 		&lt;mkdir dir=&quot;${build}&quot;/&gt;
-		&lt;javac srcdir=&quot;${src}&quot; destdir=&quot;${build}&quot;/&gt;
+		&lt;javac srcdir=&quot;${src}&quot; destdir=&quot;${build}&quot; debug=&quot;true&quot;/&gt;
 	&lt;/target&gt;
 	&lt;target name=&quot;create_run_jar&quot; depends=&quot;compile&quot;&gt;
 		&lt;jar destfile=&quot;${basedir}/hobbes.jar&quot; filesetmanifest=&quot;mergewithoutmain&quot;&gt;</diff>
      <filename>build.xml</filename>
    </modified>
    <modified>
      <diff>@@ -1,11 +1,3 @@
-# TODO: 
-# - Range#toSet
-# - Int % Int =&gt; Int
-# - String#toNumber
-# - String#split(',') =&gt; ['','']
-# - catch NoSuchElementException =&gt; throw KeyboardInterrupt
-# - real option parser
-
 class Board {
   def init(values) {
     @values = values</diff>
      <filename>examples/sudoku.hb</filename>
    </modified>
    <modified>
      <filename>hobbes.sh</filename>
    </modified>
    <modified>
      <diff>@@ -102,7 +102,7 @@ public class Debugger extends Interpreter {
 				for(SourceLine l: file.getFollowingLines(tree.getLine().getLineNo(),SURR_LINES))
 					System.out.println(&quot;  &quot; + l.show());
 			} else {
-				System.out.println(evalFunc(command,null).realToString());
+				System.out.println(evalFunc(command,null).show());
 			}
 		}
 	}</diff>
      <filename>src/hobbes/interpreter/Debugger.java</filename>
    </modified>
    <modified>
      <diff>@@ -96,8 +96,10 @@ public class Interpreter {
 			try {
 				HbObject result = run(tree);
 				String toReturn = null;
-				if(result != null)
+				if(result != null) {
 					toReturn = result.show();
+					getCurrentFrame().getScope().assignForce(&quot;_&quot;,result);
+				}
 				return toReturn;
 			} catch(ErrorWrapper e) {
 				handleError(e);
@@ -227,7 +229,7 @@ public class Interpreter {
 										throws ErrorWrapper, HbError, Continue, Break {
 		HbFunction func = (HbFunction)eval(call.getFuncExpr());
 		String funcRepr = func instanceof HbAnonymousFunction ?
-							func.hbToString().getValue() :
+							func.show() :
 							((HbNamedFunction)func).getName();
 		HbObject[] args = evalArgs(call.getArgs(),func,
 							funcRepr,call.getParenLoc());
@@ -252,7 +254,7 @@ public class Interpreter {
 		// push frame
 		try {
 			pushFrame(new NormalFunctionFrame(new Scope(this,getCurrentFrame().getScope()),
-								func.realToString(),parenLoc));
+								func.show(),parenLoc));
 		} catch (HbStackOverflow e) {
 			throw new ErrorWrapper(e,parenLoc);
 		}
@@ -321,11 +323,17 @@ public class Interpreter {
 			throw new ErrorWrapper(e,parenLoc);
 		}
 		if(func.getName().equals(&quot;print&quot;)) {
-			System.out.println(args[0].realToString());
+			if(args[0].getHbClass().hasMethod(&quot;toString&quot;))
+				System.out.println(args[0].realToString());
+			else
+				System.out.println(args[0].show());
 			popFrame();
 			return objSpace.getNil();
 		} else if(func.getName().equals(&quot;get_input&quot;)) {
-			System.out.print(args[0].realToString());
+			if(args[0].getHbClass().hasMethod(&quot;toString&quot;))
+				System.out.print(args[0].realToString());
+			else
+				System.out.print(args[0].show());
 			Scanner in = new Scanner(System.in);
 			popFrame();
 			try {
@@ -356,7 +364,7 @@ public class Interpreter {
 		HbObject lastResult = null;
 		while(s.hasNext()) {
 			try {
-				tokenizer.addLine(f.addLine(s.next()));
+				tokenizer.addLine(f.addLine(s.nextLine()));
 				if(tokenizer.isReady()) {
 					SyntaxNode tree = parser.parse(tokenizer.getTokens());
 					lastResult = run(tree);
@@ -440,7 +448,7 @@ public class Interpreter {
 		try {
 			hobbesClass = (HbClass)eval(expr.getClassVar());
 		} catch(ClassCastException e) {
-			throw new ErrorWrapper(new HbNotAClassError(this,className),
+			throw new ErrorWrapper(new HbTypeError(this,className + &quot; is not a class&quot;),
 									expr.getClassVar().getOrigin().getStart());
 		}
 		// get Java class
@@ -782,7 +790,8 @@ public class Interpreter {
 			if(sc instanceof HbClass)
 				superclass = ((HbClass)sc).getName();
 			else
-				throw new ErrorWrapper(new HbNotAClassError(this,def.getSuperclass().getName()),
+				throw new ErrorWrapper(new HbTypeError(this,def.getSuperclass().getName()
+									+ &quot; is not a class&quot;),
 									def.getSuperclass().getOrigin().getStart());
 		}
 		if(!superclass.equals(&quot;Object&quot;) &amp;&amp; objSpace.getBuiltinClasses().contains(superclass))</diff>
      <filename>src/hobbes/interpreter/Interpreter.java</filename>
    </modified>
    <modified>
      <diff>@@ -67,7 +67,6 @@ public class ObjectSpace {
 		addNativeClass(HbReadOnlyError.class);
 		addNativeClass(HbKeyError.class);
 		addNativeClass(HbTypeError.class);
-		addNativeClass(HbNotAClassError.class);
 		// set builtin classes
 		for(String className: classes.keySet())
 			builtinClasses.add(className);</diff>
      <filename>src/hobbes/interpreter/ObjectSpace.java</filename>
    </modified>
    <modified>
      <diff>@@ -40,7 +40,7 @@ public class HbAnonymousFunction extends HbFunction {
 	}
 	
 	public String getRepr() throws ErrorWrapper, HbError, Continue, Break {
-		return realToString();
+		return show();
 	}
 	
 	@HobbesMethod(name=&quot;toString&quot;)</diff>
      <filename>src/hobbes/values/HbAnonymousFunction.java</filename>
    </modified>
    <modified>
      <diff>@@ -14,9 +14,14 @@ public class HbFalse extends HbObject {
 		return this;
 	}
 	
+	@HobbesMethod(name=&quot;show&quot;)
+	public HbString hbShow() {
+		return getObjSpace().getString(&quot;false&quot;);
+	}
+	
 	@HobbesMethod(name=&quot;toString&quot;)
 	public HbString hbToString() {
-		return getObjSpace().getString(&quot;false&quot;);
+		return hbShow();
 	}
 
 }</diff>
      <filename>src/hobbes/values/HbFalse.java</filename>
    </modified>
    <modified>
      <diff>@@ -22,8 +22,8 @@ public class HbFloat extends HbObject {
 		return value;
 	}
 	
-	@HobbesMethod(name=&quot;toString&quot;)
-	public HbString hbToString() {
+	@HobbesMethod(name=&quot;show&quot;)
+	public HbString hbShow() {
 		return getObjSpace().getString(String.valueOf(value));
 	}
 	</diff>
      <filename>src/hobbes/values/HbFloat.java</filename>
    </modified>
    <modified>
      <diff>@@ -29,8 +29,8 @@ public class HbInt extends HbObject {
 		return &quot;&lt;Int val=&quot; + getValue() + &quot;&gt;&quot;;
 	}
 	
-	@HobbesMethod(name=&quot;toString&quot;)
-	public HbString hbToString() {
+	@HobbesMethod(name=&quot;show&quot;)
+	public HbString hbShow() {
 		return getObjSpace().getString(String.valueOf(value));
 	}
 	</diff>
      <filename>src/hobbes/values/HbInt.java</filename>
    </modified>
    <modified>
      <diff>@@ -47,8 +47,8 @@ public class HbList extends HbObject {
 		return newList;
 	}
 	
-	@HobbesMethod(name=&quot;toString&quot;)
-	public HbString hbToString() throws ErrorWrapper, HbError, Continue, Break {
+	@HobbesMethod(name=&quot;show&quot;)
+	public HbString hbShow() throws ErrorWrapper, HbError, Continue, Break {
 		StringBuilder repr = new StringBuilder(&quot;[&quot;);
 		Iterator&lt;HbObject&gt; it = elements.iterator();
 		while(it.hasNext()) {</diff>
      <filename>src/hobbes/values/HbList.java</filename>
    </modified>
    <modified>
      <diff>@@ -14,9 +14,14 @@ public class HbNil extends HbObject {
 		return getObjSpace().getFalse();
 	}
 	
+	@HobbesMethod(name=&quot;show&quot;)
+	public HbString hbShow() {
+		return getObjSpace().getString(&quot;nil&quot;);
+	}
+	
 	@HobbesMethod(name=&quot;toString&quot;)
 	public HbString hbToString() {
-		return getObjSpace().getString(&quot;nil&quot;);
+		return hbShow();
 	}
 
 }</diff>
      <filename>src/hobbes/values/HbNil.java</filename>
    </modified>
    <modified>
      <diff>@@ -62,16 +62,6 @@ public class HbObject extends Throwable {
 		return call(&quot;==&quot;,new HbObject[]{other}) == getObjSpace().getTrue();
 	}
 	
-	@HobbesMethod(name=&quot;toString&quot;)
-	public HbString hbToString() throws ErrorWrapper, HbError, Continue, Break {
-		StringBuilder repr = new StringBuilder(&quot;&lt;&quot;);
-		repr.append(getHbClass().getName());
-		repr.append(&quot;@&quot;);
-		repr.append(getId());
-		repr.append(&quot;&gt;&quot;);
-		return getObjSpace().getString(repr.toString());
-	}
-	
 	@HobbesMethod(name=&quot;is_a?&quot;,numArgs=1)
 	public HbObject isA(HbObject klass) throws HbArgumentError {
 		if(klass instanceof HbClass) {
@@ -80,16 +70,30 @@ public class HbObject extends Throwable {
 			throw new HbArgumentError(getInterp(),&quot;is_a?&quot;,klass,&quot;Class&quot;);
 	}
 	
-	public String realToString() throws ErrorWrapper, HbError, Continue, Break {
-		HbObject repr = call(&quot;toString&quot;);
+	public String show() throws ErrorWrapper, HbError, Continue, Break {
+		HbObject repr = call(&quot;show&quot;);
 		if(repr instanceof HbString)
 			return ((HbString)repr).getValue();
 		else
-			throw new HbTypeError(getInterp(),&quot;toString must return a String&quot;);
+			throw new HbTypeError(getInterp(),&quot;show() must return a String&quot;);
 	}
 	
-	public String show() throws ErrorWrapper, HbError, Continue, Break {
-		return realToString();
+	@HobbesMethod(name=&quot;show&quot;)
+	public HbString hbShow() throws ErrorWrapper, HbError, Continue, Break {
+		StringBuilder repr = new StringBuilder(&quot;&lt;&quot;);
+		repr.append(getHbClass().getName());
+		repr.append(&quot;@&quot;);
+		repr.append(getId());
+		repr.append(&quot;&gt;&quot;);
+		return getObjSpace().getString(repr.toString());
+	}
+	
+	public String realToString() throws ErrorWrapper, HbError, Continue, Break {
+		HbObject result = call(&quot;toString&quot;);
+		if(result instanceof HbString)
+			return ((HbString)result).getValue();
+		else
+			throw new HbTypeError(getInterp(),&quot;toString() must return a String&quot;);
 	}
 	
 	public HbObject call(String methodName, HbObject[] args) throws ErrorWrapper, HbError,</diff>
      <filename>src/hobbes/values/HbObject.java</filename>
    </modified>
    <modified>
      <diff>@@ -60,9 +60,9 @@ public class HbRange extends HbObject {
 	public HbString hbToString() throws ErrorWrapper, HbError, Continue, Break {
 		StringBuilder repr = new StringBuilder();
 		repr.append(&quot;&lt;Range &quot;);
-		repr.append(start.realToString());
+		repr.append(start.show());
 		repr.append(&quot; to &quot;);
-		repr.append(end.realToString());
+		repr.append(end.show());
 		repr.append(&quot;&gt;&quot;);
 		return getObjSpace().getString(repr);
 	}
@@ -102,6 +102,14 @@ public class HbRange extends HbObject {
 		return toReturn;
 	}
 	
+	@HobbesMethod(name=&quot;toSet&quot;)
+	public HbSet toSet() throws ErrorWrapper, HbError, Continue, Break {
+		HbSet toReturn = new HbSet(getInterp());
+		for(HbObject cur=start; cur.lt(end) || cur.eq(end); cur=cur.call(&quot;succ&quot;))
+			toReturn.add(cur);
+		return toReturn;
+	}
+	
 	public IterImp iterator() {
 		return new IterImp(start,end);
 	}</diff>
      <filename>src/hobbes/values/HbRange.java</filename>
    </modified>
    <modified>
      <diff>@@ -87,8 +87,8 @@ public class HbSet extends HbObject {
 		elements.put(obj,getObjSpace().getTrue());
 	}
 	
-	@HobbesMethod(name=&quot;toString&quot;)
-	public HbString hbToString() throws ErrorWrapper, HbError, Continue, Break {
+	@HobbesMethod(name=&quot;show&quot;)
+	public HbString hbShow() throws ErrorWrapper, HbError, Continue, Break {
 		StringBuilder repr = new StringBuilder(&quot;{&quot;);
 		Iterator&lt;HbObject&gt; it = elements.getKeys().iterator();
 		while(it.hasNext()) {</diff>
      <filename>src/hobbes/values/HbSet.java</filename>
    </modified>
    <modified>
      <diff>@@ -4,8 +4,8 @@ import hobbes.interpreter.Interpreter;
 
 public class HbStackOverflow extends HbError {
 
-	public HbStackOverflow(Interpreter o) {
-		super(o, null);
+	public HbStackOverflow(Interpreter i) {
+		super(i, null);
 	}
 	
 }</diff>
      <filename>src/hobbes/values/HbStackOverflow.java</filename>
    </modified>
    <modified>
      <diff>@@ -18,10 +18,6 @@ public class HbString extends HbObject {
 		this(i,&quot;&quot;);
 	}
 	
-	public HbString(Interpreter i, Character val) {
-		this(i,val.toString());
-	}
-	
 	public HbString(Interpreter i, String val) {
 		super(i);
 		value = val;
@@ -49,8 +45,9 @@ public class HbString extends HbObject {
 		return &quot;&lt;String@&quot; + getId() + &quot; val=&quot; + getValue() + &quot;&gt;&quot;;
 	}
 	
-	public String show() {
-		return &quot;'&quot; + sanitizedValue() + &quot;'&quot;;
+	@HobbesMethod(name=&quot;show&quot;)
+	public HbString hbShow() {
+		return getObjSpace().getString(&quot;'&quot; + sanitizedValue() + &quot;'&quot;);
 	}
 	
 	@HobbesMethod(name=&quot;toString&quot;)
@@ -100,7 +97,7 @@ public class HbString extends HbObject {
 	
 	@HobbesMethod(name=&quot;+&quot;,numArgs=1)
 	public HbString plus(HbObject other) throws HbError, ErrorWrapper, Continue, Break {
-		return getObjSpace().getString(getValue() + other.realToString());
+		return getObjSpace().getString(getValue() + other.show());
 	}
 	
 	@HobbesMethod(name=&quot;*&quot;,numArgs=1)</diff>
      <filename>src/hobbes/values/HbString.java</filename>
    </modified>
    <modified>
      <diff>@@ -9,9 +9,14 @@ public class HbTrue extends HbObject {
 		super(o);
 	}
 	
+	@HobbesMethod(name=&quot;show&quot;)
+	public HbString hbShow() {
+		return getObjSpace().getString(&quot;true&quot;);
+	}
+	
 	@HobbesMethod(name=&quot;toString&quot;)
 	public HbString hbToString() {
-		return getObjSpace().getString(&quot;true&quot;);
+		return hbShow();
 	}
 
 }</diff>
      <filename>src/hobbes/values/HbTrue.java</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>src/hobbes/values/HbNotAClassError.java</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>07565b9bc253b9d329e7ee02281d72f22701db13</id>
    </parent>
  </parents>
  <author>
    <name>Pete Vilter</name>
    <email>bonasaurus1@gmail.com</email>
  </author>
  <url>http://github.com/bonasaurus1/hobbes/commit/905a1ba67bec908e99b3627a6fef47e1b1f41685</url>
  <id>905a1ba67bec908e99b3627a6fef47e1b1f41685</id>
  <committed-date>2009-06-19T08:59:50-07:00</committed-date>
  <authored-date>2009-06-19T08:59:50-07:00</authored-date>
  <message>fixed string repr stuff. closes #84</message>
  <tree>9fb43b015596334a131c50019aa5c8493835c711</tree>
  <committer>
    <name>Pete Vilter</name>
    <email>bonasaurus1@gmail.com</email>
  </committer>
</commit>
