----- Original Message ----- 
From: "Michael Walter" <[EMAIL PROTECTED]>
To: "Paul G" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, July 31, 2004 1:59 PM
Subject: Re: [PHP-DEV] GOTO operator


--- snip ---

> > presumably, you see the need in C because it's the cleanest way to
free()
> > all you've malloc()ed along the way, regardless of where you've errored
out.
> > in PHP, you've got gc, which (again presumably) makes you think we don't
> > need goto. i say that we alloc() stuff quite often, but it may be
objects,
> > resources, what have you instead of chunks.
> It's interesting that there is the desire for a low-level construct such
> as "goto" in order to implement scoped deallocation/deconstruction. I
> suppose something like C#' using() statement might help you in this
> case, although suggesting it will surely lead to another discussion ;)

actually, alloc/dealloc was just used as an example. it could be anything -
rollback, closing sockets, pretty much any sort of 'undoing' that you need
to do to make it look like nothing ever happened ;) what you are suggesting
is similar to the hack i'm using now and referred to in an earlier mail, ie
registering thingers to be 'undone'. while useful for certain things, it's
too verbose for the majority of situations When Done Here(tm).

paul

paul

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to