Re: comparator in match pattern

2023-06-28 Thread Damien Mattei
seems to works now: scheme@(guile-user)> (match (list 1 /) ((c (? (cut equal? <> /))) 'cool)) $2 = cool On Wed, Jun 28, 2023 at 9:47 PM Damien Mattei wrote: > > thank you, ok , i understand ,my Scheme+ redefined <> to not = , this > was the problem, i apologize > > On Wed, Jun 28, 2023 at 5:27 P

Re: comparator in match pattern

2023-06-28 Thread Damien Mattei
thank you, ok , i understand ,my Scheme+ redefined <> to not = , this was the problem, i apologize On Wed, Jun 28, 2023 at 5:27 PM Vivien Kraus wrote: > > Le mercredi 28 juin 2023 à 17:10 +0200, Damien Mattei a écrit : > > Vivien , your solution is not working: > > > > (let ((/ 42)) > > (match

Re: comparator in match pattern

2023-06-28 Thread Vivien Kraus
Le mercredi 28 juin 2023 à 17:10 +0200, Damien Mattei a écrit : > Vivien , your solution is not working: > > (let ((/ 42)) >   (match (list 1 42) >     ((c (? (cut equal? <> /))) > c))) > ;;; :30:2: warning: wrong number of arguments to `# (lambda () (lambda-case ((() #f #f #f () ()) (call (t

Re: comparator in match pattern

2023-06-28 Thread Damien Mattei
Vivien , your solution is not working: (let ((/ 42)) (match (list 1 42) ((c (? (cut equal? <> /))) c))) ;;; :30:2: warning: wrong number of arguments to `#) (lexical / /-1dff1b83541ce327-407)>' ice-9/boot-9.scm:1685:16: In procedure raise-exception: Wrong number of arguments to 42

Re: comparator in match pattern

2023-06-28 Thread Vivien Kraus
Le mercredi 28 juin 2023 à 15:51 +0200, Vivien Kraus a écrit : > So, you want to match against the / symbol, not the value of a > variable > named /? Sorry, I misread. You actually have a variable named /. So this code is the only relevant one: (use-modules (ice-9 match) (srfi srfi-26)) (let ((/

Re: comparator in match pattern

2023-06-28 Thread Vivien Kraus
Le mercredi 28 juin 2023 à 15:38 +0200, Damien Mattei a écrit : > scheme@(guile-user)> (use-modules (ice-9 match)) > scheme@(guile-user)> (match (list 1 /) ((list c (cut equal? <> /)) So, you want to match against the / symbol, not the value of a variable named /? The simplest case would be to us

Re: comparator in match pattern

2023-06-28 Thread Damien Mattei
hello i do not understand how i can do that with match: scheme@(guile-user)> (use-modules (ice-9 match)) scheme@(guile-user)> (match (list 1 /) ((list c (cut equal? <> /)) 'cool) ((list c t) 'not_cool)) ice-9/boot-9.scm:1685:16: In procedure raise-exception: Throw to key `match-error' with args `(

Re: comparator in match pattern

2023-06-28 Thread Vivien Kraus
Hello! Le mercredi 28 juin 2023 à 10:44 +0200, Damien Mattei a écrit : > does it exists in Guile something like == in Racket, > documented here: > https://docs.racket-lang.org/reference/match.html#%28form._%28%28lib._racket%2Fmatch..rkt%29._~3d~3d%29%29 >From what I understand, (== something) wou