unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* abstracting Lisp strings - macro name convention?
@ 2002-06-30 23:13 Ken Raeburn
  2002-07-02  7:37 ` Richard Stallman
  0 siblings, 1 reply; 8+ messages in thread
From: Ken Raeburn @ 2002-06-30 23:13 UTC (permalink / raw)



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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2002-07-04  7:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-30 23:13 abstracting Lisp strings - macro name convention? Ken Raeburn
2002-07-02  7:37 ` Richard Stallman
2002-07-03  2:09   ` Ken Raeburn
2002-07-03 13:13     ` Stefan Monnier
2002-07-03 14:06     ` Kim F. Storm
2002-07-03 13:16       ` Miles Bader
2002-07-03 13:17       ` Henrik Enberg
2002-07-04  7:07     ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).