Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

wcmatch-list-list Any comments?

1 view
Skip to first unread message

Doug Broad

unread,
Jun 18, 2002, 4:57:24 PM6/18/02
to
Thought the NG needed something more than *fish* take-out orders
and problem solving requests. Any interest in this little function?

;;D. C. Broad 18 JUN 2002
;;Following Bill Wilkerson's (TT's?) example this
;;will return the first matching pair of word and pattern
(defun wcmatch-list-list (words patterns / r)
(vl-some
(function
(lambda (w / uw)
(setq uw (strcase w))
(vl-some
(function
(lambda (p)
(and (wcmatch uw (strcase p))
(setq r (cons w p)))))
patterns)))
words)
r)

;;Example
;;(wcmatch-list-list '("this" "is" "a" "test") '("abc" "a*"))
;;Returns ("a" . "a*")

Regards,
Doug


Tony Tanzillo

unread,
Jun 18, 2002, 6:11:09 PM6/18/02
to
FYI, I am not Bill Wilkerson.

Bill happens to be the CAD manager and senior
in-house developer for one of my largest clients.

He's not been around here since that little fiasco,
though and I really can't blame 'em.

"Doug Broad" <dbr...@earthlink.net> wrote in message
news:244B08D3339F0F52...@in.WebX.maYIadrTaRb...

Doug Broad

unread,
Jun 18, 2002, 6:43:22 PM6/18/02
to
Thanks for clearing that up Tony. I wasn't really sure.
BTW: thanks for all your recent contributions.
Doug

"Tony Tanzillo" <tony.tanzillo at caddzone dot com> wrote in message news:D073D9B5D2AB7C34...@in.WebX.maYIadrTaRb...

Jim Short

unread,
Jun 19, 2002, 9:40:29 AM6/19/02
to
I like it.

Can you illustrate some cool uses for it?

Jim

"Doug Broad" <dbr...@earthlink.net> wrote in message
news:244B08D3339F0F52...@in.WebX.maYIadrTaRb...

Doug Broad

unread,
Jun 19, 2002, 3:01:43 PM6/19/02
to
Jim,

I came up with it as part of another program that automatically labels
titleblocks and re-keys all the reference symbols within the boundaries
of the titleblock. I wanted the program to recognize a variety of naming
conventions for titleblocks without asking the user what size the titleblock
was.

NENTSEL returns the most deeply nested entity and also returns each
parent nested entity. With a list of nested block names, it was necessary
to check each of those names against a list of recognizable pattern
strings. In order to stop at the first found match, I used the nested loop.
A return value of T or nil didn't seem as useful as which block name was
matching so that's how I wrote it.

Lets say a line, part of a generic titleblock, part of a project titleblock with
a name that relates just to the project is selected.

(nestedblocks (nentsel)) might return '("tblockd" "tblockkhawk")
But the generic titleblock name could also be tblockd1, tbld or some other
form

(wcmatch-list-list '("tblockd" "tblockhawk") '("tb*d" "*blkd" "t*d#"))
would return a non-nil value and keep me from having to enumerate each
possible titleblock name. Of course my name is too long. Should have
been "wcmatch-lists"

That's one application. Can you think of more? Sorry if this is rambling on.
One limitation is that it won't work in R14.

Regards,
Doug

"Jim Short" <jim.not.tahlinc.com> wrote in message news:01E1DE2ABF1A3E56...@in.WebX.maYIadrTaRb...

R. Robert Bell

unread,
Jun 19, 2002, 3:46:57 PM6/19/02
to
Too much... That was the only application I could come up with, and here it
is the one you use!

--
R. Robert Bell, MCSE
www.AcadX.com


"Doug Broad" <dbr...@earthlink.net> wrote in message

news:40531B8480BE7432...@in.WebX.maYIadrTaRb...

0 new messages