unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Timothy Sample <samplet@ngyro.com>
To: swedebugia <swedebugia@riseup.net>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: Help with match
Date: Fri, 10 May 2019 09:53:20 -0400	[thread overview]
Message-ID: <87ftpm76wf.fsf@ngyro.com> (raw)
In-Reply-To: <0e685f33-9404-1a4a-25c8-45e34cb21a58@riseup.net> (swedebugia@riseup.net's message of "Thu, 9 May 2019 12:04:38 +0200")

Hi swedebugia,

swedebugia <swedebugia@riseup.net> 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	other threads:[~2019-05-10 13:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-09 10:04 Help with match swedebugia
2019-05-10 13:53 ` Timothy Sample [this message]
2019-05-10 15:44   ` swedebugia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ftpm76wf.fsf@ngyro.com \
    --to=samplet@ngyro.com \
    --cc=guix-devel@gnu.org \
    --cc=swedebugia@riseup.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).