[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lex function for values
From: |
Ben Pfaff |
Subject: |
Re: lex function for values |
Date: |
Sat, 23 May 2009 20:26:12 -0700 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) |
John Darrington <address@hidden> writes:
> On Fri, May 22, 2009 at 08:03:36AM -0700, Ben Pfaff wrote:
> John Darrington <address@hidden> writes:
>
> > It struck me that the value-rep branch would lend itself to a function
> > of the form:
> >
> > bool lex_match_value (struct lexer* , union value *);
> >
> >
> > which would be useful for matching either a string or a number.
>
> (A width would also need to be passed in.)
>
> The width could be infered from the length of the string.
You mean, from the length of lex_tokstr(lexer)? I don't think
that would help to distinguish string values from numeric values,
at least.
> Is this useful very often?
>
> Enough to make it worthwhile I think. We currently have something
> like this in t-test.q (for the grouping variable). Similarly, I can
> envisage that any procedure where grouping or categorical values are
> involved, particularly dichotomous ones might need this.
OK. That's good enough for me.
--
Ben Pfaff
http://benpfaff.org