chicken-abbrev/abbrev.svnwiki

47 lines
1 KiB
Text

== abbrev
[[toc:]]
=== Description
Calculate the set of unique abbreviations for a list of strings.
This library is a port of the equivalent Ruby library.
=== Authors
Original Snow library: Peter Lane
Chicken port: [[/users/lilianna-smolska|Lilianna Smólska]]
=== Repository
[[https://git.linuxposting.xyz/afiw/chicken-abbrev]]
=== API
==== abbrev
<procedure>(abbrev strings #!optional prefix)</procedure>
Returns an association list mapping unique abbreviations to the matching string.
If prefix is present, only includes abbreviations that have that prefix.
=== Examples
<enscript highlight="scheme">
(import (chicken base) (abbrev))
(define abbrevs (abbrev '("scheme" "scala" "lisp")))
(alist-ref "sch" abbrevs string=?) ; => "scheme"
</enscript>
=== Changelog
* 0.1 - Initial port from original Snow library
=== License
SPDX-License-Identifier: LicenseRef-OWL-0.9.4
SPDX-FileCopyrightText: 2017 Peter Lane
SPDX-FileCopyrightText: 2025 afiw <afiw@linuxposting.xyz>
See COPYING file for full license text.