From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by sourceware.org (Postfix) with ESMTPS id 3EAB5388216F for ; Sun, 19 Nov 2023 07:23:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3EAB5388216F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3EAB5388216F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::52c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700378631; cv=none; b=Oc2c/RAOozHlSlNvWbfjXaVFnTGH5tKCsS13Hk0u8xrXJkIOT3AIcRNVUtdCeXzRjMiYuPhA+1QbXvV0r6mnGt2oYvb5RQxXJYfmNshM9Xpd/pDmT0FPBKI662C3Lb3vQh2HD1LhZokAbrjbaPERhjR5WDaNMLkkNwb+7fobyvk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700378631; c=relaxed/simple; bh=UERTp5xzVU4LsMjLuEX1E/SgIkn94cSrR9hXwgh04eM=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=aI4+src3bkr7yaHXuXWT7Rsu6yfS2mTiixDxqY3yrM023hvwPgSSADV8ZgMQP8Iek0AsFPPUFGKP2mULMGZMgVX2UMjPa6ibtORc2rpfPlpQMjPgQUVOAlv1zC+g2lf4DLDynWGwG9F5ZmU/VWkBYJqonYl89XQOiGTCjE/dCHo= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-548a2c20f50so301324a12.1 for ; Sat, 18 Nov 2023 23:23:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700378627; x=1700983427; darn=sourceware.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=VSCDHZAtOIyTKCNzpkmO2TZmpyyKQ2JSnWEio7t2Teg=; b=bJuxHk/OH++1KWkcEX3tycXb+e9TCtu+t2OWdHYNlz5yQXvMQ9ZtNlmo29wNRWoK8M bKn8j+MGIT5rMtec+LZS+mpV/lQf2TXESoPJR9u+gAs7tb5EgXJ/Sorgnopy2y4ojQlY C5EHpJSBvhxqeDf51+MnT0GZRSyFpFmD+zpfYyWU7NLtnitZF8ELACCpad78MT8/NHOp qXhtOB0Xl4HgPicyyxZkbus8KQhYc6umUCvODeSPBfdi3OoNubI8D5lV8h/RE1v0/IZu XP8BSTclsQCmHKqPF3aVHUS5zfKTsmmLGswZuTUpF/VUlnCPKvmxXGZDWTRJYInnlgmx K6JA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700378627; x=1700983427; h=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=VSCDHZAtOIyTKCNzpkmO2TZmpyyKQ2JSnWEio7t2Teg=; b=bnSyfHGQI6x9bk0vVdez/jZpPoLScOIsNIId2Yc7bBlZ1aEdvltaVBxS8y66YiylZm vL9edpVi83E9uLVw2esNHYQr+0IsZEG6TEJjf1Bn4+w3T4QetFWLJjlTv30ak1Geh8ti ezZjjYD9nLt0sf5V+hCiQSraZqmj3LdcC87PEVC4cgmYKmS4ZQvZw03bqxP2bTlGWYlC nk7B4g+LSyESZdgrMn0uSPWgWHfBSsrY5TGJDNYc97dTM7LwtKamhjSVnQ6aEaYNcZNS +a1jY+snuHOK9x5G10CSWYsMC860i1G6RrDAAb+fetNBz00w5QT4yWdfMHMWDTLYQ27l 7dTQ== X-Gm-Message-State: AOJu0YzYpo9gWFgU6+On4NkU+8RBEGYowivfCm/v6icJj1r3k+Jm6Uaa nT8aJSDUhf9t2JVDDNRJt5xpSXC993+vP//9TEDwKDZ66lFxUA== X-Google-Smtp-Source: AGHT+IHVIev5tqnnJvZyZgqA+znABvJPqoFaNqxB6BP43dxLeR4S0YH2dTNLfA1DZUjKy+dPMWf+CMigOgHTaZ0OMMs= X-Received: by 2002:a05:6402:1650:b0:544:57c8:ccc3 with SMTP id s16-20020a056402165000b0054457c8ccc3mr3596747edx.1.1700378627270; Sat, 18 Nov 2023 23:23:47 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Damien Mattei Date: Sun, 19 Nov 2023 08:23:34 +0100 Message-ID: Subject: Re: n arity with method To: kawa mailing list Content-Type: multipart/alternative; boundary="0000000000000fed55060a7c40c7" X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: --0000000000000fed55060a7c40c7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable when comparing speed on the first part of my program written in Scheme+ it run in 15" with Kawa and 7" in Racket. the speed is the same in all kawa version. the REPL version is: https://github.com/damien-mattei/AI_Deep_Learning/blob/main/exo_retropropag= ationNhidden_layers_matrix_v2_by_vectors4kawa%2B.scm the compiled classes version is: https://github.com/damien-mattei/AI_Deep_Learning/blob/main/exo_retropropag= ationNhidden_layers_matrix_v2_by_vectors4kawa_classes%2B.scm the new and latest version of Scheme+ for Kawa is now tested and available here: https://github.com/damien-mattei/Scheme-PLUS-for-Kawa docs are here: https://damien-mattei.github.io/Scheme-PLUS-for-Racket/Scheme+io.html On Sat, Nov 18, 2023 at 12:14=E2=80=AFPM Damien Mattei wrote: > seems there is some difference in 'load' and 'import' ,the same program > can run with 'load' and not with 'import' > about the overloading of n-arity operators i find a solution in > 'define-method' : > > (define =E2=8B=85 (make-procedure method: (lambda (x ::number y ::number)= (* x y)) > method: (lambda (x ::matrix y ::matrix) (multiply-matrix-matrix x y)) > method: (lambda (x ::matrix y ::vector) (multiply-matrix-vector x y)) > method: (lambda lyst (apply * lyst)))) > > > (insert-operator! * =E2=8B=85) > > kawa -d classes > -Dkawa.import.path=3D".:/Users/mattei/Scheme-PLUS-for-Kawa:./kawa" -C > exo_retropropagationNhidden_layers_matrix_v2_by_vectors4kawa_classes.scm > > i hoped to have a speed up by compiling the kawa code in .class files but > it is the same , i suppose that 'load' compile the code , ad he does it > with more easyness than 'require' , with 'load' the overloading features = of > Scheme+ worked fine , not with 'require' > > > > On Thu, Nov 16, 2023 at 11:53=E2=80=AFPM Damien Mattei > wrote: > >> (import (rename (scheme base) (* orig*))) >> >> (define * (make-procedure method: (lambda (x ::number y ::number) (orig* >> x y)) >> method: (lambda (x ::matrix y ::matrix) (multiply-matrix-matrix x y)) >> method: (lambda (x ::matrix y ::vector) (multiply-matrix-vector x y)))) >> >> is there a way to still have * a n-arity operator with typed methods ? >> because now i have this error: >> (* 2 3 4) >> Argument (null) has wrong type >> at gnu.mapping.CallContext.matchError(CallContext.java:185) >> at gnu.expr.GenericProc.applyToConsumerGP(GenericProc.java:132) >> at gnu.kawa.functions.ApplyToArgs.applyToConsumerA2A(ApplyToArgs.java:13= 2) >> at gnu.mapping.CallContext.runUntilDone(CallContext.java:586) >> at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:343) >> at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211) >> at kawa.Shell.run(Shell.java:289) >> at kawa.Shell.run(Shell.java:196) >> at kawa.Shell.run(Shell.java:183) >> at kawa.repl.processArgs(repl.java:724) >> at kawa.repl.main(repl.java:830) >> the problem is that * is no more n-arity operator now >> >> Damien >> >> anyway there is perheaps a possibility of using a variable number of args >> but i did not think it this evening.... perheaps tomorrow... >> > --0000000000000fed55060a7c40c7--