On Wed, Feb 11, 2009 at 11:24 AM, Hans - softflow.co.uk
<[email protected]> wrote:
>
> On Feb 11, 4:01 pm, The Editor <[email protected]>
>> Here's essentially what I'll be doing. Let's say you have a string
>> like: term field=value 'two' three="3" and you pass it through
>> BOLTargs. It comes back like this:
>>
>> [''][0] => term
>> [''][1] => two
>> [field] => value
>> [three] => 3
>>
>> Now it will come back just like this, which should make it easier for
>> plugin developers. Simple change, but will break some existing
>> plugins, obviously.
>>
>> [1] => term
>> [2] => two
>> [field] => value
>> [three] => 3
>
> Dan -
>
> just a question about Boltargs argument parsing:
> Will the change prevent use of numeric parameter keys? Maybe they are
> already not allowed, in which case there is no loss. But if they are
> allowed, one could get into trouble.
Currently numeric keys are allowed, though no core function or plugin
to my knowledge makes use of them. With the new code numeric keys will
also be allowed, with the slight change that 1=text will be exactly
equivalent to "text" in the first unlabeled position.
And as you point out this could potentially cause problems. For
example, take the string:
term 2=test2 field=value 'two' three="3" 1=test
In the current BOLTargs this parses to:
[''][0] => term
[''][1] => two
[2] => test2
[field] => value
[three] => 3
[1] => test
In the new code it will parse to:
[1] => test
[2] => two
[field] => value
[three] => 3
As is, the last value (position or numeric label) will overwrite the
earlier one. However, I feel the benefits of simpler code, and easier
plugin development outweighs any liability connected with this, though
I might be overlooking something. Of course, it's easy enough to tweak
the code so you could get output like this:
[1] => term
[2] => two
[#2] => test2
[field] => value
[three] => 3
[#1] => test
Adding the # symbol for specific numeric field names. Just I'm not
sure it's worth the extra line of code... What do you think?
Cheers,
Dan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"BoltWire" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/boltwire?hl=en
-~----------~----~----~----~------~----~------~--~---