This is the mail archive of the kawa@sources.redhat.com 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]

Can't compile mutually-recursive modules


Consider these modules, which are mutually recursive via exported
functions:
  (module-name 'M1)
  (require <kb7.mm3.general.M2>)

  (define (f1 x)
    (if (eq? x '())
      '()
    ;else
      (list 'f1 (f2 (cdr x)))
    )
  )

  (module-name 'M2)
  (require <kb7.mm3.general.M1>)

  (define (f2 x)
    (if (eq? x '())
      '()
    ;else
      (list 'f2 (f1 (cdr x)))
    )
  )

Then with Kawa 1.6.99, I can't compile M1, because M2 doesn't exist in
compiled form:
  [d:\kb7\mm3\general]java kawa.repl -d \. -P kb7.mm3.general. -C M1.scm
  (compiling M1.scm)
  Internal error while compiling M1.scm
  java.lang.RuntimeException: no such class: kb7.mm3.general.M2
        at gnu.bytecode.ObjectType.getReflectClass(ObjectType.java:60)
and the same happens with M2.

(This is a contrived example for diagnostic purposes, but I do have a
real-life situation which provoked the same error.)

I have the same problem, not surprisingly, if the modules are mutually
dependent through other constructs, such as a define-simple-class in each
which has a field of type defined in the other.

I need to solve this wrgently, because on it depends some Kawa code that
I'm to demo at a conference a week from now. Any ideas?

Jocelyn Paine
http://www.ifs.org.uk/~popx/


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