public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: Damien Mattei <damien.mattei@gmail.com>
To: kawa mailing list <kawa@sourceware.org>
Subject: difference between REPL and compiled
Date: Thu, 16 Nov 2023 15:25:21 +0100	[thread overview]
Message-ID: <CADEOadcgL2buQCMVzERPozkuM2cnWnvi7izRZ5ta4Vn7Pwiwbg@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2030 bytes --]

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

                 reply	other threads:[~2023-11-16 14:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADEOadcgL2buQCMVzERPozkuM2cnWnvi7izRZ5ta4Vn7Pwiwbg@mail.gmail.com \
    --to=damien.mattei@gmail.com \
    --cc=kawa@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).