unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: swedebugia <swedebugia@riseup.net>
To: guix-devel <guix-devel@gnu.org>
Subject: Help with match
Date: Thu, 9 May 2019 12:04:38 +0200	[thread overview]
Message-ID: <0e685f33-9404-1a4a-25c8-45e34cb21a58@riseup.net> (raw)


[-- Attachment #1.1.1: Type: text/plain, Size: 279 bytes --]

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 :/

-- 
Cheers Swedebugia

[-- Attachment #1.1.2: match-error.txt --]
[-- Type: text/plain, Size: 1578 bytes --]

scheme@(guile-user) [8]> (let ((l '(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)))))
		       (match l           ;; <- the input object
         (('asd-record (who (_ val)) ...)  ;; <- the pattern
          who)))          ;; <- the expression evaluated upon matching
<unnamed port>:170:23: Throw to key `match-error' with args `("match" "no matching pattern" (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))))'.

Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
scheme@(guile-user) [9]> (let ((l '(asd-record (license-line (text-until-dq MIT)))))
		       (match l           ;; <- the input object
         (('asd-record (who (_ val)) ...)  ;; <- the pattern
          who)))          ;; <- the expression evaluated upon matching
$5 = (license-line)

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

             reply	other threads:[~2019-05-10  9:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-09 10:04 swedebugia [this message]
2019-05-10 13:53 ` Help with match Timothy Sample
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=0e685f33-9404-1a4a-25c8-45e34cb21a58@riseup.net \
    --to=swedebugia@riseup.net \
    --cc=guix-devel@gnu.org \
    /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).