|
From: | Gary V. Vaughan |
Subject: | Re: FYI: 16-gary-refactor-symbol-api.patch |
Date: | Thu, 26 Jun 2003 20:08:01 +0100 |
User-agent: | Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.3) Gecko/20030312 |
Akim Demaille wrote:
> - switch (VALUE_TYPE (argv[i])) > + if (m4_is_symbol_value_text (argv[i])) > { > - case M4_SYMBOL_TEXT: > m4_trace_format ("%l%S%r", M4ARG (i)); > - break; > - > - case M4_SYMBOL_FUNC: > - bp = m4_builtin_find_by_func (NULL, VALUE_FUNC (argv[i])); > + } > + else if (m4_is_symbol_value_func (argv[i])) > + { > + bp = m4_builtin_find_by_func (NULL, > + m4_get_symbol_value_func(argv[i])); > if (bp == NULL) > { > M4ERROR ((warning_status, 0, "\ Wow, this is a pity. I did not understand the rationale very well here, but since I considering adding some more object types, I appreciated having a enum-like handling.
Mostly because I want to move as much fluff as possible out of the exported API. Also I am trying to follow a lispier style with 'type-p?' style guards which are easier to add without perturbing the code outside the API... that is, if you want to add another object type in a module, you can continue to use the same style as the core by adding a new type-p function.
Actually there probably could be some hooks in the m4_symbol_value struct to hold a void * to help module writers add their own data types. Feel free to add a note to TODO, or submit an edit to my m4 wiki page so we don't forget about it after the release.
Anyway, congrats on the refactoring, your work is impressive.
Thanx! It's nice to get a pat on the back once in a while. I had forgotten how much was left to do...
Cheers, Gary. -- ())_. Gary V. Vaughan gary@(oranda.demon.co.uk|gnu.org) ( '/ Research Scientist http://www.oranda.demon.co.uk ,_())____ / )= GNU Hacker http://www.gnu.org/software/libtool \' `& `(_~)_ Tech' Author http://sources.redhat.com/autobook =`---d__/
[Prev in Thread] | Current Thread | [Next in Thread] |