| 
      
      
      From: Timothy J. H. <tim...@ma...> - 2004-07-19 16:32:52
      
     | 
| On Jul 19, 2004, at 12:13 PM, Ken Anderson wrote:
> At 11:54 AM 7/19/2004 -0400, Alan Donovan wrote:
>> On Mon, Jul 19, 2004 at 11:24:26AM -0400, Ken Anderson wrote:
>>> Tim, i'd like to propose this as a new definition of eqv?
This looks fine to me (after adding in Character.class....)
---Tim---
>>> (define (atomicClass? c)
>>>   (or (eq? c Boolean.class)
>>>       (eq? c Byte.class)
>>>       (eq? c Short.class)
>>>       (eq? c Integer.class)
>>>       (eq? c Long.class)
>>>       (eq? c Float.class)
>>>       (eq? c Double.class)
>>>       (eq? c Symbol.class)))
>>
>> (and don't forget Character.class)
>>
>>
>>> (define (eqv? x y)
>>>   (or (eqv? x y)
                   (eq? x y)
>>>       (let ((c (.getClass x)))
>>>         (and (atomicClass? c)
>>>              (eq? c (.getClass y))
>>>              (.equals x y)))))
>>
>> I think there's a typo for 'eq?' on line 2.
>>
>> What about the #null value?
This is handled by the (eq? x y) clause..
>> This would (unfortunately) require extra
>> cases because (.getClass #null) fails.\
> Questions and comments are always welcome!
> BTW, i should mention to the group that Alan gave a great talk at BBN 
> last week on JDK 1.5 and automatic conversion of 1.4 code to 1.5:
> http://pag.csail.mit.edu/~adonovan/pubs/slides-bbn-jul04.pdf
Nice!
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by BEA Weblogic Workshop
> FREE Java Enterprise J2EE developer tools!
> Get your free copy of BEA WebLogic Workshop 8.1 today.
> http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
> _______________________________________________
> Jscheme-user mailing list
> Jsc...@li...
> https://lists.sourceforge.net/lists/listinfo/jscheme-user
 |