Am Mittwoch, 9. Oktober 2013, 14:17:36 schrieb Michael Davidsaver:
> On 10/09/2013 11:17 AM, Benjamin Franksen wrote:
> > Am Mittwoch, 9. Oktober 2013, 16:38:53 schrieb Johnson, Andrew N.:
> >> Question for core developers: Should we modify the Enum string
> >> parser
> >> to try using case-independent or other fuzzy string comparisons if
> >> a
> >> string value doesn't match using the case-dependent comparison or
> >> after trying to convert the string to an integer? We could make the
> >> IOC dwim ("do what I mean", a Perl term) in the case below, but the
> >> result is a less precise database so I'm not sure if this is a good
> >> idea or not and how far we should take it.
> >
> > I share your reservations about making the parser more dwim. My main
> > objective is that it makes the specification more complex.
>
> Me too. It is occasionally annoying, but I think better in the long
> term, to have strict matching.
I would vote for strict matching *if* we had an established convention
how to name choices. Unfortunately this is not the case and for reasons
of tradition and compatibility it is probably not going to happen.
Therefore I see a case for some very limited sort of dwimming, namely:
(1) Case-insensitive matching.
(2) Identifying underline '_' and space ' '.
Both points listed have a simple, straight-forward specification.
And for both we lack an established convention: some choices are upper
case, some lower, some mixed; some choices use underline to separate
words, some use space. This makes the exact spelling of the choice names
hard to remember.
On the other hand, we might actually chose to establish a convention. My
favourite candidate would be to use all lower case and space as a word
separator. That would mean changing lots of menu definitions and now the
problem becomes one of compatibility. That could be solved by an
extension of the dbd syntax that allows to define aliases for menu
choice names.
Cheers
Ben
--
"Make it so they have to reboot after every typo." -- Scott Adams
Attachment:
signature.asc
Description: This is a digitally signed message part.
- Replies:
- Re: Enumerated string comparisons Eric Norum
- References:
- Re: Enumerated string comparisons Benjamin Franksen
- Re: Enumerated string comparisons Michael Davidsaver
- Navigate by Date:
- Prev:
Re: Enumerated string comparisons Michael Davidsaver
- Next:
Re: Enumerated string comparisons Eric Norum
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
<2013>
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: Enumerated string comparisons Michael Davidsaver
- Next:
Re: Enumerated string comparisons Eric Norum
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
<2013>
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|