News for hackers. Stuff that matters.
Re:Pattern matching accepted for Python by bjoli on Wednesday February 10, 2021 @12:45PM (#26092367)
Well, of course. It is a pattern matcher. case NOT_FOUND: is a pattern that matches anything and binds it to NOT_FOUND. If you want to match the content of a variable you need to signal that in some way. In scheme that usually means unquote:

    (define not-found 404)
    (match status
      (,not-found (do-stuff))
      (else (display "you might believe this is an else clause, but it actually just matches everything and binds it to else")))

There are no comments on this comment yet.