unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Help with match
@ 2019-05-09 10:04 swedebugia
  2019-05-10 13:53 ` Timothy Sample
  0 siblings, 1 reply; 3+ messages in thread
From: swedebugia @ 2019-05-09 10:04 UTC (permalink / raw)
  To: guix-devel


[-- 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 --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-10 15:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-09 10:04 Help with match swedebugia
2019-05-10 13:53 ` Timothy Sample
2019-05-10 15:44   ` swedebugia

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).