Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] It's time_t to Party!
- Date: Wed, 07 Dec 2005 11:56:50 +0900
- From: "Stephen J. Turnbull" <stephen@example.com>
- Subject: Re: [tlug] It's time_t to Party!
- References: <20051202154627.GB4348@example.com> <20051202152527.302e2f6f.jep200404@example.com> <20051203122655.GG4348@example.com> <20051203092314.3118db01.jep200404@example.com> <20051204100726.GH4348@example.com> <30ce84360512040313l351f16c4r1872cb4f6f34679e@example.com> <20051206082734.GB4319@example.com> <20051206134111.28de6309.jep200404@example.com> <87zmnem4nh.fsf@example.com> <20051206144930.63297738.jep200404@example.com>
- Organization: The XEmacs Project
- User-agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.5-b23 (daikon, linux)
>>>>> "Jim" == Jim <jep200404@example.com> writes: Jim> I can't think of a better way to salvage printf(), especially Jim> if something like TYPE_T_F was adopted in the headers as a Jim> standard (if appropriate). I think it would better be encapsulated in a stringifier, a la strftime. In production code I'd have a qxe_strftype function encapsulating the #define logic. ("qxe" is the XEmacs standard internal prefix for functions that encapsulate implementation- dependent behavior.) The way the XEmacs Lisp API handles this is to give each type of Lisp object a number of standard internal methods, a couple of routines for allocating, initializing, and finalizing, a routine for marking during garbage collection, and one for stringifying the object. These are not available to Lisp programs, of course. They're called automatically by the Lisp engine (for allocation and marking), or by the generic object printer. Python does the same. In C, you can't give objects methods, so the way I think this should be standardized is to say that every standard `struct TYPE_t' should have a strfTYPE function which takes a `struct TYPE_t' (or `struct TYPE_t *') and a format string, with % converters for each struct member. Jim> I would make that a little bit more flexible by leaving out Jim> the '%' to allow for more modifiers: I thought about that. I decided to make it inflexible because I don't really think it's an interface that should be exposed to people who have real work to do. This is the kind of interface that was invented to keep geeks "happily occupied for hours". I didn't think about how to do it right until you forced me to. ;-) -- School of Systems and Information Engineering http://turnbull.sk.tsukuba.ac.jp University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN Ask not how you can "do" free software business; ask what your business can "do for" free software.
- References:
- [tlug] timing for geeks :)
- From: Michal Hajek
- Re: [tlug] timing for geeks
- From: Jim
- Re: [tlug] timing for geeks
- From: Michal Hajek
- Re: [tlug] A Rich Experiment Indeed
- From: Jim
- Re: [tlug] A Rich Experiment Indeed
- From: Michal Hajek
- Re: [tlug] A Rich Experiment Indeed
- From: Ian Wells
- Re: [tlug] timing for geeks II.
- From: Michal Hajek
- Re: [tlug] It's time_t to Party!
- From: Jim
- Re: [tlug] It's time_t to Party!
- From: Stephen J. Turnbull
- Re: [tlug] It's time_t to Party!
- From: Jim
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] "UTF-8 & ISO-2022-JP"
- Next by Date: [tlug] "TLUG, Meet Husi, Husi, Meet TLUG"
- Previous by thread: Re: [tlug] It's time_t to Party!
- Next by thread: Re: [tlug] timing for geeks II.
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links