ends-with

Started by Kazimir Majorinc, February 12, 2010, 01:52:59 PM

Previous topic - Next topic

Kazimir Majorinc

currently]
http://kazimirmajorinc.com/\">WWW site; http://kazimirmajorinc.blogspot.com\">blog.

Lutz

#1
I believe when using lists, you mostly look for the single element with 'starts/ends-with'.



But you could use 'match' for that case:


> (match '(* h o) '(h i h o))
((h i))
> (match '(h i *) '(h i h o))
((h o))
> (match '(x y *) '(h i h o))
nil
>


the first two cases are Boolean 'true'



Ps: there was a time when 'match' could also be used for strings, but it got deprecated for the more powerful regex string matching. Although less powerful, perhaps the string matching with 'match' had some attractiveness to it? It definitely was easier to grasp mentally.