From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Ken Raeburn Newsgroups: gmane.emacs.devel Subject: abstracting Lisp strings - macro name convention? Date: Sun, 30 Jun 2002 19:13:02 -0400 Sender: emacs-devel-admin@gnu.org Message-ID: NNTP-Posting-Host: localhost.gmane.org X-Trace: main.gmane.org 1025478888 10939 127.0.0.1 (30 Jun 2002 23:14:48 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 30 Jun 2002 23:14:48 +0000 (UTC) Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17Onu3-0002qK-00 for ; Mon, 01 Jul 2002 01:14:47 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17OnyK-0001eu-00 for ; Mon, 01 Jul 2002 01:19:12 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 17OnuK-00008p-00; Sun, 30 Jun 2002 19:15:04 -0400 Original-Received: from 146-115-123-35.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com ([146.115.123.35] helo=raeburn.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 17OnsO-0008Tj-00 for ; Sun, 30 Jun 2002 19:13:04 -0400 Original-Received: from kal-el.raeburn.org ([3ffe:1ce1:0:fe31:201:2ff:fe23:e26d]) by raeburn.org (8.11.3/8.11.3) with ESMTP id g5UND3l11612; Sun, 30 Jun 2002 19:13:03 -0400 (EDT) Original-Received: from raeburn by kal-el.raeburn.org with local (Exim 3.35 #1 (Debian)) id 17OnsM-00034f-00; Sun, 30 Jun 2002 19:13:02 -0400 Original-To: emacs-devel@gnu.org Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:5283 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:5283 I'd like to give Lisp_String the same treatment I gave Lisp_Cons a while back, hiding all the knowledge about the internal structure in the lisp.h macros, except for the creation and GC code. The goal, of course, is to make the string implementation more easily replaceable, either with Guile code or anything else someone comes up with to improve string handling. The string-related macros currently follow two different naming conventions. One set (STRING_BYTES, STRING_MULTIBYTE, SET_STRING_BYTES) has been around a long time, but doesn't cover all the functionality I need; most code still uses XSTRING()->data to get at the contents. And there are some "convenience macros", some of which are already closer to what I need: /* Convenience macros for dealing with Lisp strings. */ #define SREF(string, index) XSTRING (string)->data[index] #define SDATA(string) XSTRING (string)->data #define SCHARS(string) XSTRING (string)->size #define SBYTES(string) STRING_BYTES (XSTRING (string)) #define SMBP(string) STRING_MULTIBYTE (string) But these short names don't follow the naming convention used for other string macros, usually STRING_FOO or SET_STRING_FOO. And outside of xdisp.c, they're not used much. However, they are in line with the names for macros for accessing Lisp arrays. If there are no objections to these names, I'll go ahead and start working on the changes, adding similar names for assignment operations and whatever else is needed; if the longer STRING_ names are preferred, I'll work up some new names in that style to use. Ken