From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by sourceware.org (Postfix) with ESMTPS id 2B6633858436 for ; Fri, 13 Oct 2023 18:59:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2B6633858436 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-9be3b66f254so34836766b.3 for ; Fri, 13 Oct 2023 11:59:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697223568; x=1697828368; darn=sourceware.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=6CfmF2EkvisWKRuZLmm3PXhcgKxM+far08Beu3a+b7o=; b=PMVtGc7+r3kYK9SnS26Re9933m9/sfWQsxCpYU0DUpAUE5qAtmci+NB3PlmTVtCkBO LyiW64kowikv7oO2NYfkOwTRCZbphgDgxGyJVVgtXC3M6nN+hALye4AB/5KdufasIl0U 6fDrqYMZ+FeML0Hk75zG3glTyGAZ6Q9jE1G6xtB9jl8cPnNA51R8Gk/vW+Hn4P2GF2We 44eJff3Z+oJym5Iez+5J12KKZwGUYcliJbbRHXbZLOU0+Y6t5Q4MpJjLohPx4aNrVN+g 4aaA4L+F1pt4K2UwXZDzWatLDdUMGoBwJFtA4ZIb4L4/Nt5WuhhOzfoYOBEURQVoOpwC urfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697223568; x=1697828368; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6CfmF2EkvisWKRuZLmm3PXhcgKxM+far08Beu3a+b7o=; b=LCBDJjA7Ky9FqDKR5cIflt44c1nnJsS/ikaXlv6sc+pOTYbyrTXLo+T41OjSewQ/lu bIzjJp4YPSaHRKRpGe0mXFVV/Ygzxk6ol7v/sx2DQHGdennMdbfC0iJpt788uivTDVJW fHeF9SxvtUFvRnbHz9N46xRvRbGWmuZt86YeTqjpJzQfQNEHGqTd6QmD/LuKnsgG5BIE GHjlKm7WVjWTBYZaRJGsqE3jxn0seCsKINC/UR+tEjnWN5O75IbGUYMOHv9z7unWElhX mG9EydtcWdUxvdghWQwIXY5JYzfke+JzNJvizKzdWJMdD+/5aMIgjbZoiYenzuR4kOiG UhTA== X-Gm-Message-State: AOJu0YzwBGm3XRFco8oM7tWRE64kyhbKKolEgrSCn8dlygkafIbBJiCG 9vi4K9yFBP6R7WfhvAGEcq4eW9WmV1q/7NIjEaQscgFdYdk= X-Google-Smtp-Source: AGHT+IEXVCpeJwQ2C8NI1kfKIKaNTCx/qdYdCcltKFagoheO6qedcNQIW/sveUKdK1AMRo/6H3EqxGWRZYEJjyXluto= X-Received: by 2002:a17:906:318f:b0:9a1:b05a:c07c with SMTP id 15-20020a170906318f00b009a1b05ac07cmr23163136ejy.55.1697223567397; Fri, 13 Oct 2023 11:59:27 -0700 (PDT) MIME-Version: 1.0 References: <87ttqu38e2.fsf@gmail.com> In-Reply-To: <87ttqu38e2.fsf@gmail.com> From: Damien Mattei Date: Fri, 13 Oct 2023 20:59:16 +0200 Message-ID: Subject: Re: include files To: Alcides Flores Cc: Damien Mattei via Kawa Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: i suppose it would work if my files defined modules inside but they are just include. for now the solutions i found are: -lauch the app from my Scheme+ directory so Scheme+ could find all its include (but if i have other includes from other directory (example matrix lib) it will not be possible -remove any include containing itself include and put all necessary include in the main file -use real module as java library classes, compile the code and launch kawa by java, the problem will then be solved as a java project with java solutions available. i tried this too with or without success: kawa --r5rs -Dkawa.import.path=3D".:/Users/mattei/Dropbox/git/Scheme-PLUS-f= or-Kawa" do not works (base) mattei@MacBook-Pro-Touch-Bar Scheme-PLUS-for-Kawa % pwd /Users/mattei/Dropbox/git/Scheme-PLUS-for-Kawa kawa --r5rs (load "../AI_Deep_Learning/exo_retropropagationNhidden_layers_matrix_v2_by_= vectors4kawa+.scm") works On Fri, Oct 13, 2023 at 4:27=E2=80=AFPM Alcides Flores wrote: > > Hello Damien > > In the case you mention. Have you tried using require for that? I have al= ways used it successfully in such situations. I.e. importing units/modules = in paths relative to the current directory of the module(s). > > (require "my-scheme-file.scm") > (require "some-dir/scheme-file1.scm") > (require "another-dir/scheme-file2.scm") > > Greetings. > > > -- > Alcides Flores. > > > El vie, oct 13 2023, Damien Mattei via Kawa escribi=C3=B3: > > > it is a problem i had long time ago on another kawa project, how can i > > include a file relative to the included file, it works for first > > included file but if the latter included file include another relative > > path file it fails: > > > > #|kawa:4|# (load > > "exo_retropropagationNhidden_layers_matrix_v2_by_vectors4kawa+.scm") > > /Users/mattei/Library/CloudStorage/Dropbox/git/AI_Deep_Learning/../Sche= me-PLUS-for-Kawa/Scheme+.scm:38:10: > > cannot open file "./rec.scm" > > /Users/mattei/Library/CloudStorage/Dropbox/git/AI_Deep_Learning/../Sche= me-PLUS-for-Kawa/Scheme+.scm:39:19: > > cannot open file "./def.scm" > > /Users/mattei/Library/CloudStorage/Dropbox/git/AI_Deep_Learning/../Sche= me-PLUS-for-Kawa/Scheme+.scm:40:19: > > cannot open file "./set-values-plus.scm" > > /Users/mattei/Library/CloudStorage/Dropbox/git/AI_Deep_Learning/../Sche= me-PLUS-for-Kawa/Scheme+.scm:41:19: > > cannot open file "./for_next_step.scm" > > /Users/mattei/Library/CloudStorage/Dropbox/git/AI_Deep_Learning/../Sche= me-PLUS-for-Kawa/Scheme+.scm:42:19: > > cannot open file "./declare.scm" > > /Users/mattei/Library/CloudStorage/Dropbox/git/AI_Deep_Learning/../Sche= me-PLUS-for-Kawa/Scheme+.scm:43:19: > > cannot open file "./condx.scm" > > /Users/mattei/Library/CloudStorage/Dropbox/git/AI_Deep_Learning/../Sche= me-PLUS-for-Kawa/Scheme+.scm:44:19: > > cannot open file "./block.scm" > > /Users/mattei/Library/CloudStorage/Dropbox/git/AI_Deep_Learning/../Sche= me-PLUS-for-Kawa/Scheme+.scm:45:19: > > cannot open file "./not-equal.scm" > > /Users/mattei/Library/CloudStorage/Dropbox/git/AI_Deep_Learning/../Sche= me-PLUS-for-Kawa/Scheme+.scm:46:19: > > cannot open file "./exponential.scm" > > /Users/mattei/Library/CloudStorage/Dropbox/git/AI_Deep_Learning/../Sche= me-PLUS-for-Kawa/Scheme+.scm:47:19: > > cannot open file "./while-do-when-unless.scm" > > /Users/mattei/Library/CloudStorage/Dropbox/git/AI_Deep_Learning/../Sche= me-PLUS-for-Kawa/Scheme+.scm:48:19: > > cannot open file "./repeat-until.scm" > > /Users/mattei/Library/CloudStorage/Dropbox/git/AI_Deep_Learning/../Sche= me-PLUS-for-Kawa/Scheme+.scm:49:19: > > cannot open file "./modulo.scm" > > /Users/mattei/Library/CloudStorage/Dropbox/git/AI_Deep_Learning/../Sche= me-PLUS-for-Kawa/Scheme+.scm:50:19: > > cannot open file "./bitwise.scm" > > /Users/mattei/Library/CloudStorage/Dropbox/git/AI_Deep_Learning/../Sche= me-PLUS-for-Kawa/Scheme+.scm:53:19: > > cannot open file "./slice.scm" > > > > file Scheme+.scm: > > > > > > ;; (load "Scheme+.scm") > > ;; (load "scheme-infix.scm") > > ;; (load "assignment.scm") > > ;; (load "apply-square-brackets.scm") > > ;; (load "array.scm") > > > > (require 'srfi-1) > > (require 'srfi-69) ;; hash table > > > > ;; try relative , use include-relative-relative if problems > > (include "./rec.scm") ; rec does not exist in Kawa (no SRFI 31) > > (include-relative "./def.scm") > > (include-relative "./set-values-plus.scm") > > (include-relative "./for_next_step.scm") > > (include-relative "./declare.scm") > > (include-relative "./condx.scm") > > (include-relative "./block.scm") > > (include-relative "./not-equal.scm") > > (include-relative "./exponential.scm") > > (include-relative "./while-do-when-unless.scm") > > (include-relative "./repeat-until.scm") > > (include-relative "./modulo.scm") > > (include-relative "./bitwise.scm") > > > > > > (include-relative "./slice.scm") > > > > file: exo_retropropagationNhidden_layers_matrix_v2_by_vectors4kawa+.sc= m > > > > ; Deep Learning : back propagation, gradient descent, neural network > > with N hidden layers > > > > ; L'algorithme de r=C3=A9tro-propagation du gradient dans un > > ; r=C3=A9seau de neurones avec N couches cach=C3=A9es. > > > > ; D. Mattei > > > > > > ; use MacVim to show ALL the characters of this file (not Emacs, not Aq= uamacs) > > ; jeu de couleurs: Torte ou Koehler > > > > ; use: (load "exo_retropropagationNhidden_layers_matrix_v2_by_vectors4k= awa+.scm") > > > > (include-relative "../Scheme-PLUS-for-Kawa/Scheme+.scm") > > > > (include-relative "../Scheme-PLUS-for-Kawa/scheme-infix.scm") > > > > (include-relative "../Scheme-PLUS-for-Kawa/assignment.scm") > > (include-relative "../Scheme-PLUS-for-Kawa/apply-square-brackets.scm") > > > > (include-relative "../Scheme-PLUS-for-Kawa/array.scm") > > > > > > i know i can , and used module for Scheme+ but ,for now i prefer > > testing with included files and any way scheme-infix assignment > > apply-square-brackets required to be included at user or main > > definition level as it modify the environment and scheme+ used a > > modified reader before that too....