From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Julian Graham Newsgroups: gmane.lisp.guile.devel Subject: [PATCH] Unicode general categories Date: Thu, 24 Dec 2009 00:46:31 -0500 Message-ID: <2bc5f8210912232146s976fb0cif6d1968d068e42ec@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=0016e6d99d7315dfb4047b72f6d3 X-Trace: ger.gmane.org 1261633826 16079 80.91.229.12 (24 Dec 2009 05:50:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 24 Dec 2009 05:50:26 +0000 (UTC) To: guile-devel Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Dec 24 06:50:19 2009 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NNgaY-0002Oj-Dm for guile-devel@m.gmane.org; Thu, 24 Dec 2009 06:50:19 +0100 Original-Received: from localhost ([127.0.0.1]:51921 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NNgaY-0004qP-Ix for guile-devel@m.gmane.org; Thu, 24 Dec 2009 00:50:18 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NNgX1-00038A-7W for guile-devel@gnu.org; Thu, 24 Dec 2009 00:46:39 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NNgWw-00036K-6m for guile-devel@gnu.org; Thu, 24 Dec 2009 00:46:38 -0500 Original-Received: from [199.232.76.173] (port=47317 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NNgWv-00036E-WA for guile-devel@gnu.org; Thu, 24 Dec 2009 00:46:34 -0500 Original-Received: from mail-ew0-f224.google.com ([209.85.219.224]:45835) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NNgWv-0002PB-QD for guile-devel@gnu.org; Thu, 24 Dec 2009 00:46:34 -0500 Original-Received: by ewy24 with SMTP id 24so9022054ewy.26 for ; Wed, 23 Dec 2009 21:46:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=lIDYS7e7GlWlPxCemJUeX0YKnO/VD9J1fmn7OgyvWeo=; b=mBwSZDxLdDl1PM3fGkyQtDoUXsx+dfBeyNOa3zi9VQh5Aa+lTt84eqYPpTMto/3BB+ r8Oo7C9Z6mpyhI8EFciyuLNsYbki1akTHGfrjUN3AqXHMRnT2RESII61G+r3s+ggCz6n B5uf2Fptotp1H+EUYkc0QN068d04ucwf35DrI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=cucyBnYM8Pt0t08CNpPnCVvWE+w5BN0tflQ3tLzox4n5Cu7xFGFKkthrbMgiFrVj2w 7mGpOl+ORMiSHMdMGJpYP1kVTiOK99mk76yrETXDNW002RI/ffqPQ7U0C5pKo+a2jPBp EXxZZNp7iLlXMG17gybZUIXHrkfeeiCUILflg= Original-Received: by 10.216.91.5 with SMTP id g5mr3974439wef.168.1261633591959; Wed, 23 Dec 2009 21:46:31 -0800 (PST) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:9794 Archived-At: --0016e6d99d7315dfb4047b72f6d3 Content-Type: text/plain; charset=ISO-8859-1 Hi all, Find attached a patch that adds support for finding out the Unicode general category [0] for a character, including documentation and unit tests. The API is pretty much the same as the one described in R6RS Standard Libraries 1.1 [1]. I'll push if no one objects. Regards, Julian [0] - http://www.unicode.org/versions/Unicode5.2.0/ch04.pdf [1] - http://www.r6rs.org/final/html/r6rs-lib/r6rs-lib-Z-H-2.html#node_sec_1.1 --0016e6d99d7315dfb4047b72f6d3 Content-Type: text/x-diff; charset=US-ASCII; name="0001-Support-for-Unicode-general-categories.patch" Content-Disposition: attachment; filename="0001-Support-for-Unicode-general-categories.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_g3l41al50 RnJvbSBmOGZlZjkwM2Q1MzVmYTljZWIyNjc3YWIwYzdkYWNjNzY5MmVhMGYzIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBKdWxpYW4gR3JhaGFtIDxqdWxpYW4uZ3JhaGFtQGF5YS55YWxl LmVkdT4KRGF0ZTogVGh1LCAyNCBEZWMgMjAwOSAwMDoyNToxOSAtMDUwMApTdWJqZWN0OiBbUEFU Q0hdIFN1cHBvcnQgZm9yIFVuaWNvZGUgZ2VuZXJhbCBjYXRlZ29yaWVzCgoqIGxpYmd1aWxlL2No YXJzLmMsIGxpYmd1aWxlL2NoYXJzLmggKHNjbV9jaGFyX2dlbmVyYWxfY2F0ZWdvcnkpOiBOZXcg ZnVuY3Rpb24uCiogdGVzdC1zdWl0ZS90ZXN0cy9jaGFycy50ZXN0OiBVbml0IHRlc3RzIGZvciBg Y2hhci1nZW5lcmFsLWNhdGVnb3J5Jy4KKiBkb2MvcmVmL2FwaS1kYXRhLnRleGkgKENoYXJhY3Rl cnMpOiBEb2N1bWVudGF0aW9uIGZvcgogIGBjaGFyLWdlbmVyYWwtY2F0ZWdvcnknLgotLS0KIGRv Yy9yZWYvYXBpLWRhdGEudGV4aSAgICAgICB8ICAgOTEgKysrKysrKysrKysrKysrKysrKysrKysr KysrKysrKysrKysrKysrKysrKwogbGliZ3VpbGUvY2hhcnMuYyAgICAgICAgICAgIHwgICAyMCAr KysrKysrKysKIGxpYmd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