Sara Golemon wrote:
>>Well, now that I think I understand what is it for,
>>I'm pretty sure it's not very appropriate for PHP(,
>>unless someone will provides an example of the opposite
>>of course).
>>
>>It's kind of clarity vs efficiency.
>>The more the basic operation ("*to = *from++" in the
>>original) is getting bigger (slower) the efficiency gain becomes
>>smaller (correct?) so I would prefer clarity here.
>>
>>I'm not even sure real example in PHP will have close to 50%
>>speed gain.
>>
>
> In the case of "Duff's Device" it certainly isn't applicable to PHP
That was my guess, you approved it.
>....It
> much for efficient for the engine to process a complex single opcode than to
> process many simple opcodes in succession. That still doesn't speak to
> whether or not there aren't truly applicable examples.
It looks like it worked just fine for that
example in _C_.
>
> Functionally the parser doesn't want to see overlapping structures like this
> and it feel non-trivial to implement. But I havn't looked at the switch
> implementation close enough to be certain yet.
>
> For the sake of readability I'm -1.
Agreed on that.
That's what I was originally talking about.
It was phrased as "messy".