difference between REPL and compiled
Damien Mattei
damien.mattei@gmail.com
Thu Nov 16 14:25:21 GMT 2023
when i try to compile this file:
https://github.com/damien-mattei/AI_Deep_Learning/blob/main/exo_retropropagationNhidden_layers_matrix_v2_by_vectors4kawa%2B.scm
i got warning but not error but i can not find the .class file:
kawa -Dkawa.import.path=".:/Users/mattei/Scheme-PLUS-for-Kawa:./kawa" -C
exo_retropropagationNhidden_layers_matrix_v2_by_vectors4kawa.scm
(compiling exo_retropropagationNhidden_layers_matrix_v2_by_vectors4kawa.scm
to exo_retropropagationNhidden_layers_matrix_v2_by_vectors4kawa)
...
exo_retropropagationNhidden_layers_matrix_v2_by_vectors4kawa.scm:7:36:
duplicate declaration of '*'
exo_retropropagationNhidden_layers_matrix_v2_by_vectors4kawa.scm:5:9: (this
is the previous declaration of '*')
exo_retropropagationNhidden_layers_matrix_v2_by_vectors4kawa.scm:8:36:
duplicate declaration of '+'
exo_retropropagationNhidden_layers_matrix_v2_by_vectors4kawa.scm:6:9: (this
is the previous declaration of '+')
/Users/mattei/Scheme-PLUS-for-Kawa/for_next_step.scm: note - skipped 0
errors, 14 warnings, 0 notes
the problem seems to be in the first lines of the parsed code:
(require (quote srfi-69))
(require matrix)
(require Scheme+)
(require array)
(import (rename (scheme base) (+ orig+)))
(import (rename (scheme base) (* orig*)))
(define-overload-existing-operator * orig*)
(define-overload-existing-operator + orig+)
(define-overload-procedure random)
(define (random-int n) (integer (* n (random))))
(overload-existing-operator * multiply-matrix-matrix (matrix? matrix?))
(overload-existing-operator * multiply-matrix-vector (matrix? vector?))
(overload-existing-operator + vector-append (vector? vector?))
(overload-procedure random java.lang.Math:random ())
i think it is the import-rename that was causing this sort of problem last
month when i had put it in modules
I suppose that the compiling now put again all the code in a module causing
somewhere the problem again
is there a way to make it compile the way it works in REPL when i load it
by hand like (load "filename.scm") ?
Damien
More information about the Kawa
mailing list