unrecognized pattern operator list

Damien Mattei damien.mattei@gmail.com
Mon Oct 9 21:07:16 GMT 2023


GRASP ,amazing code , would be wonderful for teaching.

On Mon, Oct 9, 2023 at 10:26 PM Panicz Maciej Godek
<godek.maciek@gmail.com> wrote:
>
> For what it's worth, I wrote my own implementation of match for Kawa 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 submitted 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 built-in match, so you cloud try adapting it to your taste.
>
> pon., 9 paź 2023 o 22:18 Damien Mattei via Kawa <kawa@sourceware.org> napisał(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 is
>> also possible to parse it with SRFI 105 and after modify again the
>> code to set back the transformed [] in () again in [] in 'match and
>> type[]  ....
>>
>>
>> On Mon, Oct 9, 2023 at 4:48 PM Damien Mattei <damien.mattei@gmail.com> wrote:
>> >
>> > hello,
>> >
>> > in this code belonging from Guile and Racket version:
>> >
>> > (match (list index1-or-keyword-eval-pos index2-or-keyword-eval-pos
>> > 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 (== slice) (== slice))
>> >       (container-copy! container-eval
>> >                0
>> >                expr-eval)
>> >
>> > i have this error:
>> > unrecognized pattern operator list near ((list (== slice) i2 (== slice))
>> > slice is defined like that:
>> >
>> > (define $ '$)
>> > (define slice $)
>> >
>> > what is the equivalent syntax for kawa?
>> >
>> > damien


More information about the Kawa mailing list