The usefullness of EQUALP

Джерело:
Common Lisp Tips

Дата публікації:
17/06/2013 22:30

Постійна адреса новини:
http://www.vsinovyny.com/8323842

The usefullness of EQUALP

 

17/06/2013 22:30 // Common Lisp Tips

Among the 4 Lisp’s equality operators equalp may be the least used, but it has some really cool features:

  • it matches strings ignoring case (this is well-known, I suppose)
  • it also matches structs
  • it also matches vectors and arrays
  • and it matches hash-tables

The last 3 are really useful, because unlike strings and other primitive types, there’s no specialized equality predicates for built-in structural types, so equalp fills this role.

(contributed by @vseloved)

 

» Читати повністю

 

« Наступна новина з архіву
Adding an item to a sorted list
  Попередня новина з архіву
Formatting integers in different radixes
»

 

 
© 2026 www.vsinovyny.com