On Tue, Jun 15, 2010 at 4:49 PM, Mario Lang mlang@delysid.org wrote:
Erik Huelsmann ehuels@gmail.com writes:
On Tue, Jun 15, 2010 at 8:47 AM, Ville Voutilainen ville.voutilainen@gmail.com wrote:
On 15 June 2010 00:26, Alessio Stalla alessiostalla@gmail.com wrote:
If there is consensus, I can prepare an update patch if need be (its simple enough anyways).
+1 :)
+1 as well.
Completely fine by me. So, it looks like we are completely in agreement :-)
OK, here is a new patch that implements the suggested behaviour:
Index: src/org/armedbear/lisp/JavaObject.java
--- src/org/armedbear/lisp/JavaObject.java (revision 12752) +++ src/org/armedbear/lisp/JavaObject.java (working copy) @@ -108,6 +108,12 @@ return super.typep(type); }
- @Override
- public LispObject STRING()
- {
- return new SimpleString(obj != null? obj.toString(): "null");
- }
public final Object getObject() { return obj;
Alternatively, here is a version that still emits a type error if the wrapped object is null. I am really not sure whats better, so I offer both versions.
Index: src/org/armedbear/lisp/JavaObject.java
--- src/org/armedbear/lisp/JavaObject.java (revision 12752) +++ src/org/armedbear/lisp/JavaObject.java (working copy) @@ -108,6 +108,14 @@ return super.typep(type); }
- @Override
- public LispObject STRING()
- {
- if (obj != null)
- return new SimpleString(obj.toString());
- return super.STRING();
- }
public final Object getObject() { return obj;
Please apply what you like the most.
I applied and committed the first one, on the basis that Java does the same conversion when using the + operator.
Thanks, Alessio