Is there a standard library or function out there that follows the same
general regular expression rules, but against lists instead of strings?
Or, put another way, I'm hoping to be able to take several different
lists, and match data to them, from most to least specific and perform
actions based on what is inside the list. For example, if I wanted to
match the arguments to the factorial function, I might write something
like this:
(if (match '(0) args)
(progn ...)
(if (match '(#'integerp) args)
(progn ...)
(error "Doesn't match any known pattern.")))
I'm just hoping there is already something out there that does
something similar so I don't have to roll my own.
Thanks!
Jeff M.
"Jeff M." <·······@gmail.com> writes:
> Is there a standard library or function out there that follows the same
> general regular expression rules, but against lists instead of strings?
> Or, put another way, I'm hoping to be able to take several different
> lists, and match data to them, from most to least specific and perform
> actions based on what is inside the list. For example, if I wanted to
> match the arguments to the factorial function, I might write something
> like this:
>
> (if (match '(0) args)
> (progn ...)
> (if (match '(#'integerp) args)
> (progn ...)
> (error "Doesn't match any known pattern.")))
>
> I'm just hoping there is already something out there that does
> something similar so I don't have to roll my own.
http://www.justfuckinggoogleit.com/search?q=common-lisp+package+match
Try it!
Location: http://www.google.com/search?as_q=common%2dlisp%20package%20match%0a&num=50&hl=en&ie=ISO8869-1&btnG=Google+Search&as_epq=&as_oq=&as_eq=&lr=&as_ft=i&as_filetype=&as_qdr=all&as_nlo=&as_nhi=&as_occt=any&as_dt=i&as_sitesearch=&safe=images
Sign in
Torino 2006 Web Images Groups News Froogle Local more �
[common-lisp package match ] Search Advanced Search
Preferences
Web Results 1 - 50 of about 124,000 for common-lisp match package . (0.19 seconds)
Tip: Save time by hitting the return key instead of clicking on "search"
UB CSE202 CHAP 29
Put a (:use common-lisp match) subform in the defpackage form, so that you can
use exported symbols from the match package without qualification in the ...
www.cse.buffalo.edu/~shapiro/ Courses/CSE202/Notes/chapter29.html - 15k -
Cached - Similar pages
UB CSE202 CHAP 12
You have mainly been using the Inferior Common Lisp mode to interact with
the ... (defpackage match) (in-package match) ----------------------- cut
here ...
www.cse.buffalo.edu/~shapiro/ Courses/CSE202/Notes/chapter12.html - 13k -
Cached - Similar pages
Running Allegro Common Lisp in XEmacs at CSU
... fi:common-lisp-mode-map (if (string-match "XEmacs" (emacs-version)) ...
The way you restrict attention to those things in the user package is with the
...
www.cs.colostate.edu/~howe/handouts/lisp-and-emacs.html - 22k -
Cached - Similar pages
ANSI and GNU Common Lisp Document - Symbols in the COMMON-LISP Package
Symbols in the COMMON-LISP Package. The figures on the next twelve pages
contain a complete enumeration of the 978 external symbols in the COMMON-LISP
...
www.cs.queensu.ca/software_docs/ gnudev/gcl-ansi/gcl_76.html - 32k -
Cached - Similar pages
ANSI and GNU Common Lisp Document - Specifiers for keyword parameters
... then the keyword name used to match arguments to parameters is
keyword-name, ... (Of course, if it is not a symbol in the KEYWORD package
, it does not ...
www.cs.queensu.ca/software_docs/ gnudev/gcl-ansi/gcl_217.html - 6k -
Cached - Similar pages
Common Lisp Extensions - Predicates
The CL package defines a version of the Common Lisp typep predicate. ... The
type symbols character and string-char match integers in the range from 0 to
...
www.chemie.fu-berlin.de/chemnet/use/info/cl/cl_3.html - 11k -
Cached - Similar pages
Common Lisp Extensions - Sequences
Common Lisp's mapcar accepts multiple arguments but works only on lists;
Emacs Lisp's mapcar accepts a single sequence argument. This package's
mapcar* ...
www.chemie.fu-berlin.de/chemnet/use/info/cl/cl_9.html - 27k -
Cached - Similar pages
[ More results from www.chemie.fu-berlin.de ]
Star Sapphire Common LISP Reference Manual--U
Star Sapphire Common LISP Home � Download Star Saphire ... It is an error to
unexport a symbol from the keyword package. unexport returns t. ...
www.webweasel.com/lisp/doc/u.htm - 21k - Cached - Similar pages
Star Sapphire Common LISP Reference Manual--Packages
The Common LISP package system is designed with a number of safety
features ... If a string is supplied, it must be so capitalized as to
match exactly the ...
www.webweasel.com/lisp/doc/cl11.htm - 47k - Cached - Similar pages
[ More results from www.webweasel.com ]
Package: lang/lisp/code/match/matcher/
Examples of use include: (match-p '((:star :wild) b :wild d) '(abcd)) ==> t (
match-p '(b ... Version: 21-JAN-91 Requires: Common Lisp Ports: Fully
portable. ...
www.cs.cmu.edu/afs/cs/project/ai-repository/ ai/lang/lisp/code/match/matcher/
0.html - 3k - Cached - Similar pages
--
__Pascal Bourguignon__ http://www.informatimago.com/
READ THIS BEFORE OPENING PACKAGE: According to certain suggested
versions of the Grand Unified Theory, the primary particles
constituting this product may decay to nothingness within the next
four hundred million years.
Well, that sure didn't help.
Yes, I used Google for quite some time before posting here, thanks. The
closest I could get was LispWorks' parsergen package, which seemed like
a bit overkill, but maybe that's the best I can do.
Did you even look at the results you got before posting them? Of
course, if somewhere on page 13 of the search results was a buried
answer to my question, I appologise, I missed it.
Jeff M.
Jeff M. wrote:
> Well, that sure didn't help.
>
> Yes, I used Google for quite some time before posting here, thanks. The
> closest I could get was LispWorks' parsergen package, which seemed like
> a bit overkill, but maybe that's the best I can do.
>
> Did you even look at the results you got before posting them? Of
> course, if somewhere on page 13 of the search results was a buried
> answer to my question, I appologise, I missed it.
Last of the pasted links. Googling for the updated location yields:
http://www-cgi.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/code/match/matcher/0.html
Paul Khuong
"Jeff M." <·······@gmail.com> writes:
> Well, that sure didn't help.
>
> Yes, I used Google for quite some time before posting here, thanks. The
> closest I could get was LispWorks' parsergen package, which seemed like
> a bit overkill, but maybe that's the best I can do.
>
> Did you even look at the results you got before posting them? Of
> course, if somewhere on page 13 of the search results was a buried
> answer to my question, I appologise, I missed it.
For example this one on the first result page is quite usable.
> Package: lang/lisp/code/match/matcher/
> Examples of use include: (match-p '((:star :wild) b :wild d) '(abcd)) ==> t (
> match-p '(b ... Version: 21-JAN-91 Requires: Common Lisp Ports: Fully
> portable. ...
> www.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/code/match/matcher/
> 0.html - 3k - Cached - Similar pages
Oops, I see now that this is exactly the only Paul indicated.
But the important point, is that to make an effective use of google
you need to know the precise keywords. So once you've fetched the
most promizing hit on the first page, you usually gather a few more
keywords:
;;; This matcher defines simple regexp-type matching of a pattern
;;; against a list expression. (Note: This is not a full regular expression
;;; matcher.)
And then you get more and better results:
Location: http://www.google.com/search?as_q=common%2dlisp%20pattern%20matcher%0a&num=50&hl=en&ie=ISO8869-1&btnG=Google+Search&as_epq=&as_oq=&as_eq=&lr=&as_ft=i&as_filetype=&as_qdr=all&as_nlo=&as_nhi=&as_occt=any&as_dt=i&as_sitesearch=&safe=images
Sign in
Torino 2006 Web Images Groups News Froogle Local more �
[common-lisp pattern matcher ] Search Advanced Search
Preferences
Web Results 1 - 50 of about 132,000 for common-lisp pattern matcher . (0.19
seconds)
--
__Pascal Bourguignon__ http://www.informatimago.com/
"Our users will know fear and cower before our software! Ship it!
Ship it and let them flee like the dogs they are!"
On 18 Feb 2006 17:23:49 -0800, "Jeff M." <·······@gmail.com> wrote:
> Is there a standard library or function out there that follows the
> same general regular expression rules, but against lists instead of
> strings?
I addition to Mark Kantrowitz' code which was already mentioned
there's also a port of CL-PPCRE to arbitrary sequences:
<http://common-lisp.net/pipermail/climacs-devel/2005-May/000210.html>
Probably not in sync with the latest CL-PPCRE version, but maybe it's
helpful.
Cheers,
Edi.
--
European Common Lisp Meeting 2006: <http://weitz.de/eclm2006/>
Real email: (replace (subseq ·········@agharta.de" 5) "edi")
On Sun, 19 Feb 2006 10:56:05 +0100, Edi Weitz wrote:
> I addition to Mark Kantrowitz' code which was already mentioned
> there's also a port of CL-PPCRE to arbitrary sequences:
>
> <http://common-lisp.net/pipermail/climacs-devel/2005-May/000210.html>
>
> Probably not in sync with the latest CL-PPCRE version, but maybe it's
> helpful.
>
> Cheers,
> Edi.
What is the "alphabet" of the language that a regular expression generates
associated with (possibly) nested lisp lists?
Matt
--
"You do not really understand something unless you can
explain it to your grandmother." — Albert Einstein.