Re: The goto statement in PHP [message #185777 is a reply to message #185776] |
Wed, 07 May 2014 19:16 |
Tim Streater
Messages: 328 Registered: September 2010
Karma:
|
Senior Member |
|
|
In article <lke0a8$gcs$1(at)news(dot)albasani(dot)net>, The Natural Philosopher
<tnp(at)invalid(dot)invalid> wrote:
> On 07/05/14 16:13, Graham Hobbs wrote:
>> On Mon, 05 May 2014 10:27:36 -0400, Jerry Stuckle
>> <jstucklex(at)attglobal(dot)net> wrote:
>>
>>> On 5/5/2014 9:50 AM, richard wrote:
>>>> In Liberty BASIC (LB) we also have branched goto labels.
>>>> As I was reading the goto manual on php.net I see where they make no
>>>> distinction between a label and a variable.
>>>> In LB it is simple.
>>>> a=0 is a distinct variable.
>>>> [a] is a distinct label.
>>>>
>>>> When goto [a] is encountered, it matters not what or where the variable
>>>> "a"
>>>> is.
>>>>
>>>> I'm just suggesting that they need a means to distinguish the pair.
>>>>
>>>
>>> Better yet - don't use goto. I never have needed it.
>> Just reminds me of the 'sphagetti' code' days.
>
> I have never NEEDED it above assembler code, it but I have occasionally
> USED it.
>
> I think its possible to say that its almost impossible to get away
> without it at assembler level.
Well, in assembler it'll just be a JMP or equivalent, won't it.
> Sometimes 'Go To jail: go directly to jail, do not pass Go, do not
> collect £200' is exactly the simplest way to express something.
I once worked with a FORTRAN compiler that gave exactly that message if
you put:
GOTO JAIL
> I've always felt Dijkstra was a bit of a Dijk...frankly.
Did he also try to insist on single-entry-single-exit for functions?
I've never paid any attention to that; early return for error
conditions is the way to do it.
--
"Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do." -- Bigby Wolf
|
|
|