#<&undefined-variable ... name: eof-object>

Oh, the issue is because Goblins exports a procedure named $, so the $ in the match expression is no longer treated as a syntax literal.

Here’s a working program:

(use-modules (hoot records)
             (ice-9 match)
             ((goblins) #:hide ($)))

(define-record-type <foo>
  (make-foo bar)
  foo?
  (bar foo-bar))

(match (list (make-foo 1) (make-foo 2))
  ((($ <foo> bar)
    ($ <foo> bar*))
   (pk (cons bar bar*))))

This gets rid of the $ operator entirely. To get it back, you can rename it with an import expression like ((goblins) #:select ($) #:prefix g:)

1 Like