guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help with match


From: Timothy Sample
Subject: Re: Help with match
Date: Fri, 10 May 2019 09:53:20 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)

Hi swedebugia,

swedebugia <address@hidden> writes:

> Hi
>
> I am almost finished with the quicklisp importer but I'm stuck with not
> being able to match what I want with the pattern matcher.
>
> I (still) don't understand the documentation for this matcher and I
> can't get it to do what I want it seems :/

Here’s your input form:

'(asd-record
  (license-line (text-until-dq MIT))
  (synopsis-line (text-until-dq An async HTTP client))
  dependencies
  (dependencies (text alexandria))
  (dependencies (text babel))
  (dependencies (text fast-io))
  (dependencies (text cl-async))
  (dependencies (text blackbird))
  (dependencies (text quri))
  (dependencies (text fast-http))
  (dependencies (text fast-io))
  (dependencies (text cl-async-ssl))
  (dependencies (text cl-cookie))
  (dependencies (text file)))

The pattern you use is “('asd-record (who (_ val)) ...)”.  The reason it
doesn’t match is because not all elements after the symbol “asd-record”
have the form “(who (_ val))” (the failing element is the one that is
just the symbol “dependencies”).  The ellipsis means that all of the
remaining elements have to match the previous pattern.

My guess is that you don’t mean to have that “dependencies” symbol
in the input.

I was just about to send this, but there’s another issue!  The
“synopsis-line” form has five elements, but the pattern “(_ val)” will
only match a two-element list.  Should the “An async HTTP client” part
should be a string?

Hope that helps and good luck with the importer!


-- Tim



reply via email to

[Prev in Thread] Current Thread [Next in Thread]