Is there any advantage to adding a specific :test argument when it's not
really needed? For example:
(delete-duplicates "ABBBBFFGEEEADCBACC" :test #'char=)
versus
(delete-duplicates "ABBBBFFGEEEADCBACC")
Carl Taylor
"Carl Taylor" <··········@att.net> wrote in message
···························@bgtnsc05-news.ops.worldnet.att.net...
> Is there any advantage to adding a specific :test argument when it's not
> really needed? For example:
>
> (delete-duplicates "ABBBBFFGEEEADCBACC" :test #'char=)
> versus
> (delete-duplicates "ABBBBFFGEEEADCBACC")
I might count it as a disadvantage that it is unnecessary distraction to the
reader. Plus, there are five other keyword arguments that might get jealous
of that special treatment!
--
Coby Beck
(remove #\Space "coby 101 @ bigpond . com")
On Fri, 20 Jan 2006 01:19:50 GMT, "Carl Taylor" <··········@att.net> wrote:
> Is there any advantage to adding a specific :test argument when it's
> not really needed? For example:
>
> (delete-duplicates "ABBBBFFGEEEADCBACC" :test #'char=)
> versus
> (delete-duplicates "ABBBBFFGEEEADCBACC")
It might be a tad more efficient. Not that it matters much in your
example above... :)
--
Lisp is not dead, it just smells funny.
Real email: (replace (subseq ·········@agharta.de" 5) "edi")
"Carl Taylor" <··········@att.net> writes:
> Is there any advantage to adding a specific :test argument when it's
> not really needed? For example:
>
> (delete-duplicates "ABBBBFFGEEEADCBACC" :test #'char=)
> versus
> (delete-duplicates "ABBBBFFGEEEADCBACC")
Well, if this was, as it presumably would be:
(delete-duplicates some-var :test #'char=)
vs
(delete-duplicates some-var)
The former will error if any of the elements of the sequence are not
characters. Which might be considered a feature if you want to detect
the type error earlier and a bug if you want this call to be more
forgiving.
-Peter
--
Peter Seibel * ·····@gigamonkeys.com
Gigamonkeys Consulting * http://www.gigamonkeys.com/
Practical Common Lisp * http://www.gigamonkeys.com/book/