This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GSOC | Extending Common Lisp support


On 21 June 2012 17:35, Jamison Hope <jrh@theptrgroup.com> wrote:
> I'm a little concerned about the correctness of that change to IsEqv.
> With it in place, what happens if you compile this Scheme function and
> then invoke it from Common Lisp?
>
> (define (scheme-case)
> Â(case 'b ((a) 'yes) (else 'no)))
>
> If it works correctly, then fantastic.

I prefer your suggestion. One unpleasant thing about my approach is
the need to Language.setCurrent(this) in the initLisp methods of CL
and Elisp so that getDefaultLanguage() doesn't return null when we're
compiling the primitive files. However, I get the following results on
your test case:

$ rlwrap java kawa.repl --clisp
#|kawa:1|# (define (scheme-case) (case 'b ((a) 'yes) (else 'no)))
#|kawa:2|# (scheme-case)
no
#|kawa:3|# (disassemble #'scheme-case)
In class atInteractiveLevel$1

Method name:"schemeCase" public static Signature: ()gnu.mapping.SimpleSymbol
Attribute "Code", length:66, max_stack:3, max_locals:0, code_length:28
  0: getstatic <Field kawa.standard.Scheme.isEqv gnu.kawa.functions.IsEqv>
  3: getstatic <Field atInteractiveLevel$1.Lit0 gnu.mapping.SimpleSymbol>
  6: getstatic <Field atInteractiveLevel$1.Lit1 gnu.mapping.SimpleSymbol>
  9: invokevirtual <Method gnu.mapping.Procedure.apply2
(java.lang.Object,java.lang.Object)java.lang.Object>
 12: getstatic <Field atInteractiveLevel$1.Lit2 gnu.lists.EmptyList>
 15: if_acmpeq 24
 18: getstatic <Field atInteractiveLevel$1.Lit3 gnu.mapping.SimpleSymbol>
 21: goto 27
 24: getstatic <Field atInteractiveLevel$1.Lit4 gnu.mapping.SimpleSymbol>
 27: areturn
Attribute "StackMapTable", length:8, number of entries: 3
  offset: 18 - same_frame
  offset: 24 - same_frame
  offset: 27 - same_locals_1_stack_item_frame
    0: gnu.mapping.SimpleSymbol
Attribute "LineNumberTable", length:6, count: 1
  line: 1 at pc: 0

Charles.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]