From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by sourceware.org (Postfix) with ESMTPS id D8F733858D32 for ; Tue, 10 Oct 2023 07:03:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D8F733858D32 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-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-53d8320f0easo299088a12.3 for ; Tue, 10 Oct 2023 00:03:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696921398; x=1697526198; darn=sourceware.org; h=content-transfer-encoding:cc:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ulHMZgImPQw24VbCuWNk0Kfvdg+A2YvQQB4b6I7LOF4=; b=NmUdnIif/J4DhyjPyWbDMpNhQBFK/HD3FN/rGfO2zX6Qf0FtfTljUhRnafuYRm8iJm W6vt30fgPvHylHCHsPANWzlTT0OqaUMFhwbDuZRp3/oySHd6djp5S6EWgjX3ky0E3Z02 9vaCbuavFb/wbrMpLYiLPDui4BCBXRFrMbSKM53Q4wsxINPCmghry5O16vURygVMIPmw IqkHKDhG7TTsBBoJQdGzXnO6QNqZ2wZEv4Q/yaMMRKDNxoVIyvamoEmMfpXsCbezjqmY mMXE4HJantV/sufOnJ1krTImVwVayeVG3qm0nmuseBN5eXxLjVO3S4VHJf9yzeYRw4G3 H4fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696921398; x=1697526198; h=content-transfer-encoding:cc: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=ulHMZgImPQw24VbCuWNk0Kfvdg+A2YvQQB4b6I7LOF4=; b=jQg44/QrjhMPLqbL2QtDosO3Er5mNl1RWEnlLQZzCqsm+zc+raADxJioVZzBJW6ckl 4EUixsfC6EbsHm4GSkKRH8p7CdooTZbnxYOsjECE1UF0gusMNh4EUX2kLyPA3E9liw8p cbHl4lKox051mHKGotL1eoby5G2pn+AO+E3sqmGLlwMAAhU28Qs8u1d0xDBpKKbXfExr G7L7atvY2s5gi0KSoXyIKt4NmX28/DMoqyBw27omtd1dpBgl6VeyKKQHS/LKUKWYfsN/ ezStFqZQkbsBGo4HzRXCBZZidQkxS/YWoPDI3mTRfsrWO31ykI7FsGACBRliu29vD0rF SbCQ== X-Gm-Message-State: AOJu0Yype7GVej7ghUFWNema5OdlU2smgudMhzEi7AlRMSG4F3gM8lco 86I9N7CpBOIA9Bw0AypSpYhhR4Gt5uvgrQ+jpbmzr2Bqq9I= X-Google-Smtp-Source: AGHT+IEWEPOhrds3fv5RISCuhxTTiXrVDfTlDJEwdTpWC2LvdplcLyIV78kWunKoegOSLMsiJC2Pw3evm4Lk3l/qCOM= X-Received: by 2002:a17:906:209a:b0:9ae:3f69:9b89 with SMTP id 26-20020a170906209a00b009ae3f699b89mr16474119ejq.7.1696921397926; Tue, 10 Oct 2023 00:03:17 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Damien Mattei Date: Tue, 10 Oct 2023 09:03:06 +0200 Message-ID: Subject: Re: unrecognized pattern operator list Cc: kawa mailing list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,MISSING_HEADERS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: ok this works: (match (list index1-or-keyword-eval-pos index2-or-keyword-eval-pos) ;; {a <+ (make-vector 7 0)} ;; '#(0 0 0 0 0 0 0) ;; > {a[$ $] <- #(1 2 3)} ;; > a ;; '#(1 2 3 0 0 0 0) ;((list (=3D=3D slice) (=3D=3D slice)) ([s1 s2] #!if (and (equal? s1 slice) (equal? s2 slice)) (container-copy! container-eval 0 expr-eval) container-eval ;; returning a value allow the chaining : {T[3 5 6] <- A[4 2 3] <- T[7 2 4]} ) ;; {s <+ (string-append "abcdefgh")} ;; "abcdefgh" ;; > {s[3 $] <- "zob"} ;; > s ;; "abczobgh" ;; > ([i1 s] #!if (equal? s slice) (container-copy! container-eval i1 expr-eval) container-eval ;; returning a value allow the chaining : {T[3 5 6] <- A[4 2 3] <- T[7 2 4]} ) ([s i2] #!if (equal? s slice) (container-copy! container-eval 0 expr-eval 0 i2) container-eval ;; returning a value allow the chaining : {T[3 5 6] <- A[4 2 3] <- T[7 2 4]} ) ([i1 i2] (cond ((vector? container-eval) ;; normal case (function-array-n-dim-set! container-eval expr-eval (reverse (list i1 i2)))) ((array? container-eval) ;;(display "assignment.* : 2 args ,array case : container-eval =3D ") (display container-eval) (newline) '(array-set! container-eval index1-or-keyword-eval index2-or-keyword-eval expr-eval)) (else ;; overloaded (define args-lst (list container-eval i1 i2)) (define setter! (find-setter-for-overloaded-square-brackets args-l= st)) '(setter! container-eval i1 i2 expr-eval))) expr-eval) ;; returning a value allow the chaining : {T[3 2] <- A[4] <- T[2 4]} ) ;; end match but if i unquote '(setter! container-eval i1 i2 expr-eval) the REPL crashes, the only way of debug was to quote the portions of code..= . On Tue, Oct 10, 2023 at 8:44=E2=80=AFAM Damien Mattei wrote: > > i talked to fast, the match pattern seems ok but i got a Kawa REPL > crash when just loading the code file now, after investigating i > localised the problem in this section : > > (cond ((vector? container-eval) ;; normal case > (function-array-n-dim-set! container-eval expr-eval (reverse > (list i1 i2)))) > ((array? container-eval) > ;;(display "assignment.* : 2 args ,array case : > container-eval =3D ") (display container-eval) (newline) > (array-set! container-eval index1-or-keyword-eval > index2-or-keyword-eval expr-eval)) > > (else ;; overloaded > (define args-lst (list container-eval i1 i2)) > (define setter! (find-setter-for-overloaded-square-brackets args= -lst)) > (setter! container-eval i1 i2 expr-eval))) > expr-eval) ;; returning a value allow the chaining : {T[3 2] <- > A[4] <- T[2 4]} > > but as the REPL crashed i have no idea of what is the problem, just > got this message: > > #|kawa:1|# (load "Scheme+.scm") > #|kawa:2|# (load "scheme-infix.scm") > scheme-infix.scm:55:13: warning - no declaration seen for !* > scheme-infix.scm:60:8: warning - no declaration seen for infix-operators-= lst > scheme-infix.scm:270:17: warning - no declaration seen for infix-operator= s-lst > #|kawa:3|# (load "assignment.scm") > assignment.scm:318:13: warning - no declaration seen for > parse-square-brackets-arguments > assignment.scm:337:11: warning - no declaration seen for assignment-argum= ent-3 > assignment.scm:346:11: warning - no declaration seen for assignment-argum= ent-4 > assignment.scm:357:11: warning - no declaration seen for assignment-argum= ent-5 > assignment.scm:369:7: warning - no declaration seen for > assignment-argument-6-and-more > assignment.scm:403:43: warning - no declaration seen for bracket-apply > assignment.scm:407:43: warning - no declaration seen for bracket-apply > assignment.scm:430:8: warning - no declaration seen for hash-table? > assignment.scm:450:8: warning - no declaration seen for hash-table? > assignment.scm:451:8: warning - no declaration seen for hash-table-set! > assignment.scm:466:24: warning - no declaration seen for > find-setter-for-overloaded-square-brackets > assignment.scm:546:5: warning - no declaration seen for > function-array-n-dim-set! > assignment.scm:553:21: warning - no declaration seen for > find-setter-for-overloaded-square-brackets > Exception in thread "main" java.lang.VerifyError: Bad local variable type > Exception Details: > Location: > atInteractiveLevel-115.assignmentArgument$Mn2(Ljava/lang/Object;Ljava= /lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; > @622: aload > Reason: > Type top (current frame, locals[30]) is not assignable to reference t= ype > Current Frame: > bci: @622 > flags: { } > locals: { 'java/lang/Object', 'java/lang/Object', > 'java/lang/Object', 'java/lang/Object', 'java/lang/Object', > 'java/lang/Object', 'java/lang/Object', 'java/lang/Object', > 'java/lang/Object', 'java/util/List', top, top, top, top, top, top, > 'java/util/List', top, top, top, top, top, top, 'java/util/List', top, > top, top, top, top, top, top, 'java/util/List', 'java/lang/Object', > 'java/lang/Object', 'java/lang/Object', 'java/lang/Object', > 'gnu/lists/Pair', 'java/lang/Object' } > stack: { } > Bytecode: > 0000000: 2b3a 042c 3a05 b200 0e3a 06b2 000e 3a07 > 0000010: 2ab8 0014 9900 10b2 0018 3a06 b200 1b3a > 0000020: 07a7 000d b200 203a 06b2 0023 3a07 b200 > 0000030: 2919 04b2 002f b600 35b6 0043 b800 489a > 0000040: 0022 1904 b200 4cb8 0052 9900 1704 b200 > 0000050: 5619 062a b600 4319 04b8 005b 3a04 a700 > 0000060: 03b2 0029 1905 b200 2fb6 0035 b600 43b8 > 0000070: 0048 9a00 2219 05b2 004c b800 5299 0017 > 0000080: 04b2 0056 1906 2ab6 0043 1905 b800 5b3a > 0000090: 05a7 0003 1904 1905 b800 613a 0819 0805 > 00000a0: b800 6759 3a09 c600 6c19 0903 b900 6c02 > 00000b0: 003a 0b19 0b3a 0a19 0904 b900 6c02 003a > 00000c0: 0d19 0d3a 0cb2 0029 190a b200 2fb6 0035 > 00000d0: b600 43b8 0048 9900 22b2 0029 190c b200 > 00000e0: 2fb6 0035 b600 43b8 0072 b800 4899 0007 > 00000f0: 04a7 0008 03a7 0004 0336 0f15 0f99 0015 > 0000100: b200 5619 072a b200 4c2d b600 7657 2aa7 > 0000110: 019c 1908 05b8 0067 593a 10c6 0053 1910 > 0000120: 03b9 006c 0200 3a12 1912 3a11 1910 04b9 > 0000130: 006c 0200 3a14 1914 3a13 b200 2919 13b2 > 0000140: 002f b600 35b6 0043 b800 72b8 0048 9900 > 0000150: 0704 a700 0403 3616 1516 9900 14b2 0056 > 0000160: 1907 2a19 112d b600 7657 2aa7 0140 1908 > 0000170: 05b8 0067 593a 17c6 007d 1917 03b9 006c > 0000180: 0200 3a19 1919 3a18 1917 04b9 006c 0200 > 0000190: 3a1b 191b 3a1a b200 2919 18b2 002f b600 > 00001a0: 35b6 0043 b800 72b8 0048 9900 0704 a700 > 00001b0: 0403 361d 151d 9900 3eb8 007a 593a 1eb2 > 00001c0: 0056 1907 3a1f 2a3a 202d 3a21 191a 3a22 > 00001d0: 191f 1920 b200 4c19 21b6 007e 191e b200 > 00001e0: 4cb6 0082 191e 1922 b600 8219 1eb6 0086 > 00001f0: 2aa7 00ba 1908 05b8 0067 593a 1fc6 00a3 > 0000200: 191f 03b9 006c 0200 3a21 1921 3a20 191f > 0000210: 04b9 006c 0200 3a23 1923 3a22 2ab8 0014 > 0000220: 9900 1fb2 0056 b200 89b6 0035 2a2d 1920 > 0000230: 1922 b800 61b8 008f b600 7657 a700 602a > 0000240: b800 9499 0011 b200 9a2a 2b2c 2db6 0076 > 0000250: 57a7 004b 2a19 2019 22b8 009e 3a24 b200 > 0000260: 56b2 00a1 b600 3519 24b6 0043 3a25 191e > 0000270: b200 5619 253a 262a 3a27 1920 3a28 1922 > 0000280: 3a29 2d3a 2a19 2619 2719 2819 29b6 007e > 0000290: 191e 192a b600 8219 1eb6 0086 2da7 000e > 00002a0: bb00 a359 b200 a7b7 00ab bfb0 5912 3911 > 00002b0: 01ea 1036 b600 3dbf 5912 3911 01ed 1036 > 00002c0: b600 3dbf 5912 3911 0203 1021 b600 3dbf > 00002d0: 5912 3911 0203 1033 b600 3dbf 5912 3911 > 00002e0: 0210 101a b600 3dbf 5912 3911 0217 101a > 00002f0: b600 3dbf 5912 3911 0222 08b6 003d bf59 > 0000300: 1239 1102 2910 15b6 003d bf > Exception Handler Table: > bci [54, 57] =3D> handler: 684 > bci [105, 108] =3D> handler: 696 > bci [205, 208] =3D> handler: 708 > bci [225, 228] =3D> handler: 720 > bci [322, 325] =3D> handler: 732 > bci [414, 417] =3D> handler: 744 > bci [553, 556] =3D> handler: 756 > bci [612, 615] =3D> handler: 767 > Stackmap Table: > full_frame(@23,{Object[#10],Object[#10],Object[#10],Object[#10],Objec= t[#10],Object[#10],Object[#10],Object[#10]},{}) > same_frame(@36) > same_frame(@46) > full_frame(@57,{Object[#10],Object[#10],Object[#10],Object[#10],Objec= t[#10],Object[#10],Object[#10],Object[#10]},{Object[#248],Object[#10],Objec= t[#10]}) > same_frame(@66) > same_frame(@77) > same_frame(@97) > full_frame(@108,{Object[#10],Object[#10],Object[#10],Object[#10],Obje= ct[#10],Object[#10],Object[#10],Object[#10]},{Object[#248],Object[#10],Obje= ct[#10]}) > same_frame(@117) > same_frame(@128) > same_frame(@148) > full_frame(@208,{Object[#10],Object[#10],Object[#10],Object[#10],Obje= ct[#10],Object[#10],Object[#10],Object[#10],Object[#10],Object[#105],Object= [#10],Object[#10],Object[#10],Object[#10]},{Object[#248],Object[#10],Object= [#10]}) > same_frame(@217) > full_frame(@228,{Object[#10],Object[#10],Object[#10],Object[#10],Obje= ct[#10],Object[#10],Object[#10],Object[#10],Object[#10],Object[#105],Object= [#10],Object[#10],Object[#10],Object[#10]},{Object[#248],Object[#10],Object= [#10]}) > same_frame(@240) > same_frame(@244) > same_locals_1_stack_item_frame(@245,Integer) > same_frame(@248) > same_locals_1_stack_item_frame(@249,Integer) > full_frame(@274,{Object[#10],Object[#10],Object[#10],Object[#10],Obje= ct[#10],Object[#10],Object[#10],Object[#10],Object[#10],Object[#105]},{}) > full_frame(@325,{Object[#10],Object[#10],Object[#10],Object[#10],Obje= ct[#10],Object[#10],Object[#10],Object[#10],Object[#10],Object[#105],Top,To= p,Top,Top,Top,Top,Object[#105],Object[#10],Object[#10],Object[#10],Object[#= 10]},{Object[#248],Object[#10],Object[#10]}) > same_frame(@337) > same_frame(@341) > same_locals_1_stack_item_frame(@342,Integer) > full_frame(@366,{Object[#10],Object[#10],Object[#10],Object[#10],Obje= ct[#10],Object[#10],Object[#10],Object[#10],Object[#10],Object[#105],Top,To= p,Top,Top,Top,Top,Object[#105]},{}) > full_frame(@417,{Object[#10],Object[#10],Object[#10],Object[#10],Obje= ct[#10],Object[#10],Object[#10],Object[#10],Object[#10],Object[#105],Top,To= p,Top,Top,Top,Top,Object[#105],Top,Top,Top,Top,Top,Top,Object[#105],Object[= #10],Object[#10],Object[#10],Object[#10]},{Object[#248],Object[#10],Object[= #10]}) > same_frame(@429) > same_frame(@433) > same_locals_1_stack_item_frame(@434,Integer) > full_frame(@500,{Object[#10],Object[#10],Object[#10],Object[#10],Obje= ct[#10],Object[#10],Object[#10],Object[#10],Object[#10],Object[#105],Top,To= p,Top,Top,Top,Top,Object[#105],Top,Top,Top,Top,Top,Top,Object[#105]},{}) > full_frame(@547,{Object[#10],Object[#10],Object[#10],Object[#10],Obje= ct[#10],Object[#10],Object[#10],Object[#10],Object[#10],Object[#105],Top,To= p,Top,Top,Top,Top,Object[#105],Top,Top,Top,Top,Top,Top,Object[#105],Top,Top= ,Top,Top,Top,Top,Top,Object[#105],Object[#10],Object[#10],Object[#10],Objec= t[#10]},{}) > full_frame(@556,{Object[#10],Object[#10],Object[#10],Object[#10],Obje= ct[#10],Object[#10],Object[#10],Object[#10],Object[#10],Object[#105],Top,To= p,Top,Top,Top,Top,Object[#105],Top,Top,Top,Top,Top,Top,Object[#105],Top,Top= ,Top,Top,Top,Top,Top,Object[#105],Object[#10],Object[#10],Object[#10],Objec= t[#10]},{Object[#250],Object[#10]}) > same_frame(@575) > same_frame(@582) > same_frame(@596) > full_frame(@615,{Object[#10],Object[#10],Object[#10],Object[#10],Obje= ct[#10],Object[#10],Object[#10],Object[#10],Object[#10],Object[#105],Top,To= p,Top,Top,Top,Top,Object[#105],Top,Top,Top,Top,Top,Top,Object[#105],Top,Top= ,Top,Top,Top,Top,Top,Object[#105],Object[#10],Object[#10],Object[#10],Objec= t[#10],Object[#252]},{Object[#250],Object[#10]}) > chop_frame(@668,1) > full_frame(@672,{Object[#10],Object[#10],Object[#10],Object[#10],Obje= ct[#10],Object[#10],Object[#10],Object[#10],Object[#10],Object[#105],Top,To= p,Top,Top,Top,Top,Object[#105],Top,Top,Top,Top,Top,Top,Object[#105],Top,Top= ,Top,Top,Top,Top,Top,Object[#105]},{}) > full_frame(@683,{Object[#10],Object[#10],Object[#10],Object[#10],Obje= ct[#10],Object[#10],Object[#10],Object[#10],Object[#10],Object[#105]},{Obje= ct[#10]}) > full_frame(@684,{Object[#10],Object[#10],Object[#10],Object[#10],Obje= ct[#10],Object[#10],Object[#10],Object[#10]},{Object[#55]}) > same_locals_1_stack_item_frame(@696,Object[#55]) > full_frame(@708,{Object[#10],Object[#10],Object[#10],Object[#10],Obje= ct[#10],Object[#10],Object[#10],Object[#10],Object[#10],Object[#105],Object= [#10],Object[#10],Object[#10],Object[#10]},{Object[#55]}) > same_locals_1_stack_item_frame(@720,Object[#55]) > full_frame(@732,{Object[#10],Object[#10],Object[#10],Object[#10],Obje= ct[#10],Object[#10],Object[#10],Object[#10],Object[#10],Object[#105],Top,To= p,Top,Top,Top,Top,Object[#105],Object[#10],Object[#10],Object[#10],Object[#= 10]},{Object[#55]}) > full_frame(@744,{Object[#10],Object[#10],Object[#10],Object[#10],Obje= ct[#10],Object[#10],Object[#10],Object[#10],Object[#10],Object[#105],Top,To= p,Top,Top,Top,Top,Object[#105],Top,Top,Top,Top,Top,Top,Object[#105],Object[= #10],Object[#10],Object[#10],Object[#10]},{Object[#55]}) > full_frame(@756,{Object[#10],Object[#10],Object[#10],Object[#10],Obje= ct[#10],Object[#10],Object[#10],Object[#10],Object[#10],Object[#105],Top,To= p,Top,Top,Top,Top,Object[#105],Top,Top,Top,Top,Top,Top,Object[#105],Top,Top= ,Top,Top,Top,Top,Top,Object[#105],Object[#10],Object[#10],Object[#10],Objec= t[#10]},{Object[#55]}) > full_frame(@767,{Object[#10],Object[#10],Object[#10],Object[#10],Obje= ct[#10],Object[#10],Object[#10],Object[#10],Object[#10],Object[#105],Top,To= p,Top,Top,Top,Top,Object[#105],Top,Top,Top,Top,Top,Top,Object[#105],Top,Top= ,Top,Top,Top,Top,Top,Object[#105],Object[#10],Object[#10],Object[#10],Objec= t[#10],Object[#252]},{Object[#55]}) > > at java.base/java.lang.Class.getDeclaredFields0(Native Method) > at java.base/java.lang.Class.privateGetDeclaredFields(Class.java:3473= ) > at java.base/java.lang.Class.getDeclaredField(Class.java:2780) > at gnu.expr.ModuleContext.findInstance(ModuleContext.java:71) > at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:286) > at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211) > at kawa.Shell.run(Shell.java:289) > at kawa.Shell.runFile(Shell.java:551) > at kawa.standard.load.apply2(load.java:67) > at kawa.standard.load.apply1(load.java:27) > at gnu.mapping.Procedure1or2.applyToObject(Procedure1or2.java:64) > at gnu.mapping.Procedure.applyToConsumerDefault(Procedure.java:75) > 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) > (base) mattei@MacBook-Pro-Touch-Bar Scheme-PLUS-for-Kawa % > > On Tue, Oct 10, 2023 at 7:33=E2=80=AFAM Damien Mattei wrote: > > > > i use 'match' for Kawa like this in my code, i haven't test it yet but > > i suppose it is ok ,having done multiple test in the Kawa REPL : > > > > (match (list index1-or-keyword-eval-pos index2-or-keyword-eval-pos) > > > > ;; {a <+ (make-vector 7 0)} > > ;; '#(0 0 0 0 0 0 0) > > ;; > {a[$ $] <- #(1 2 3)} > > ;; > a > > ;; '#(1 2 3 0 0 0 0) > > ;((list (=3D=3D slice) (=3D=3D slice)) > > ([s1 s2] #!if (and (equal? s1 slice) (equal? s2 slice)) > > (container-copy! container-eval > > 0 > > expr-eval) > > container-eval ;; returning a value allow the chaining : {T[3 5 > > 6] <- A[4 2 3] <- T[7 2 4]} > > ) > > > > ;; {s <+ (string-append "abcdefgh")} > > ;; "abcdefgh" > > ;; > {s[3 $] <- "zob"} > > ;; > s > > ;; "abczobgh" > > ;; > > > ([i1 s] #!if (equal? s slice) > > (container-copy! container-eval > > i1 > > expr-eval) > > container-eval ;; returning a value allow the chaining : {T[3 5 > > 6] <- A[4 2 3] <- T[7 2 4]} > > ) > > > > ([s i2] #!if (equal? s slice) > > (container-copy! container-eval > > 0 > > expr-eval > > 0 > > i2) > > container-eval ;; returning a value allow the chaining : {T[3 5 > > 6] <- A[4 2 3] <- T[7 2 4]} > > ) > > > > ([i1 i2] > > (cond ((vector? container-eval) ;; normal case > > (function-array-n-dim-set! container-eval expr-eval (reverse > > (list i1 i2)))) > > ((array? container-eval) > > ;;(display "assignment.* : 2 args ,array case : > > container-eval =3D ") (display container-eval) (newline) > > (array-set! container-eval index1-or-keyword-eval > > index2-or-keyword-eval expr-eval)) > > > > (else ;; overloaded > > (define args-lst (list container-eval i1 i2)) > > (define setter! (find-setter-for-overloaded-square-brackets ar= gs-lst)) > > (setter! container-eval i1 i2 expr-eval))) > > expr-eval) ;; returning a value allow the chaining : {T[3 2] <- > > A[4] <- T[2 4]} > > > > ) ;; end match > > > > i can not find another way than: > > > > #!if (and (equal? s1 slice) (equal? s2 slice) > > > > to test equality to '($ $) or (list slice slice) , that does not look > > like a pattern and i could have use 'cond' instead of 'match' as there > > is little gain in syntax here. > > > > On Mon, Oct 9, 2023 at 11:07=E2=80=AFPM Damien Mattei wrote: > > > > > > GRASP ,amazing code , would be wonderful for teaching. > > > > > > On Mon, Oct 9, 2023 at 10:26=E2=80=AFPM Panicz Maciej Godek > > > wrote: > > > > > > > > For what it's worth, I wrote my own implementation of match for Kaw= a and use it in GRASP: > > > > > > > > https://github.com/panicz/grasp/blob/main/src/language/match.scm > > > > > > > > It is derived from the now withdrawn SRFI-200 document that I submi= tted at some point: > > > > > > > > https://srfi.schemers.org/srfi-200/srfi-200.html > > > > > > > > (it contains a fairly detailed description of the implementation of= the match macro, both in syntax-case and syntax-rules) > > > > > > > > Anyway, it doesn't seem to be causing any conflicts with Kawa's bui= lt-in match, so you cloud try adapting it to your taste. > > > > > > > > pon., 9 pa=C5=BA 2023 o 22:18 Damien Mattei via Kawa napisa=C5=82(a): > > > >> > > > >> one of problem is coming from the special syntax of kawa that= use > > > >> [ ] where others scheme don't and incompatible with SRFI 105, this > > > >> limits some use. > > > >> like: in type[] or match with patterns looking like ([_ y] ... > > > >> this would be a good idea to have an option in Kawa that allow > > > >> replacing those [ ] by normal ( ) or even be compatible with the 2 > > > >> syntaxes should be possible > > > >> > > > >> in my case i dislike 'match form and do not using typing in scheme > > > >> when available so this not a big problem in my codes but for now i= do > > > >> not know how to modify the SRFI-105 reader for be compatible. It i= s > > > >> also possible to parse it with SRFI 105 and after modify again the > > > >> code to set back the transformed [] in () again in [] in 'match an= d > > > >> type[] .... > > > >> > > > >> > > > >> On Mon, Oct 9, 2023 at 4:48=E2=80=AFPM Damien Mattei wrote: > > > >> > > > > >> > hello, > > > >> > > > > >> > in this code belonging from Guile and Racket version: > > > >> > > > > >> > (match (list index1-or-keyword-eval-pos index2-or-keyword-eval-p= os > > > >> > index3-or-keyword-or-step-eval-pos) > > > >> > > > > >> > > > > >> > > > > >> > > > > >> > ;; {a <+ (make-vector 7 0)} > > > >> > ;; '#(0 0 0 0 0 0 0) > > > >> > ;; > {a[$ $] <- #(1 2 3)} > > > >> > ;; > a > > > >> > ;; '#(1 2 3 0 0 0 0) > > > >> > ((list (=3D=3D slice) (=3D=3D slice)) > > > >> > (container-copy! container-eval > > > >> > 0 > > > >> > expr-eval) > > > >> > > > > >> > i have this error: > > > >> > unrecognized pattern operator list near ((list (=3D=3D slice) i2= (=3D=3D slice)) > > > >> > slice is defined like that: > > > >> > > > > >> > (define $ '$) > > > >> > (define slice $) > > > >> > > > > >> > what is the equivalent syntax for kawa? > > > >> > > > > >> > damien