Re: [PHP-DEV] New construct discussion Summary

2004-07-13 Thread l0t3k
> LOL. I sure as hell don't know what color to paint a nuclear power plant. > flourescent green ? -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] New construct discussion Summary

2004-07-13 Thread Marc Richards
Adam Maccabee Trachtenberg wrote: On Mon, 12 Jul 2004, John Coggeshall wrote: Not to bust everyone's bubble here, but frankly what is the point of a 90-100+ thread on this? I mean can't this just be implemented as a PHP function without all this discussion? Maybe we should name the function bike

Re: [PHP-DEV] New construct discussion Summary

2004-07-13 Thread Wez Furlong
+1 ;) On Mon, 12 Jul 2004 22:44:00 -0400 (EDT), Adam Maccabee Trachtenberg <[EMAIL PROTECTED]> wrote: > On Mon, 12 Jul 2004, John Coggeshall wrote: > > > Not to bust everyone's bubble here, but frankly what is the point of a > > 90-100+ thread on this? I mean can't this just be implemented as a P

Re: [PHP-DEV] New construct discussion Summary (was: what happened to that new isset() like language construct)

2004-07-13 Thread Antony Dovgal
On Tue, 13 Jul 2004 09:12:19 +0200 (CEST) Derick Rethans <[EMAIL PROTECTED]> wrote: > On Mon, 12 Jul 2004, George Schlossnagle wrote: > > > what was wrong with nvl() (of oracle fame)? > > Nobody else but oracle people have any idea what they expect when they > see nvl(). Agree. Moreover, it's t

Re: [PHP-DEV] New construct discussion Summary (was: what happened to that new isset() like language construct)

2004-07-13 Thread Derick Rethans
On Mon, 12 Jul 2004, George Schlossnagle wrote: > what was wrong with nvl() (of oracle fame)? Nobody else but oracle people have any idea what they expect when they see nvl(). Derick -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] New construct discussion Summary (was: what happened to that new isset() like language construct)

2004-07-12 Thread Marcus Boerger
Hello Andi, wow i didn't remember seeing that. So with default being a reserved word to me it seems like one of the best choices. Monday, July 12, 2004, 10:01:47 PM, you wrote: > It's a reserved word so I doubt it'll break scripts. > Andi > At 05:37 PM 7/12/2004 +0200, Marcus Boerger wro

Re: [PHP-DEV] New construct discussion Summary

2004-07-12 Thread Adam Maccabee Trachtenberg
On Mon, 12 Jul 2004, John Coggeshall wrote: > Not to bust everyone's bubble here, but frankly what is the point of a > 90-100+ thread on this? I mean can't this just be implemented as a PHP > function without all this discussion? Maybe we should name the function bikeshed()? :) http://www.unixgu

Re: [PHP-DEV] New construct discussion Summary

2004-07-12 Thread John Coggeshall
Not to bust everyone's bubble here, but frankly what is the point of a 90-100+ thread on this? I mean can't this just be implemented as a PHP function without all this discussion? Coogle. -- -=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=--=~=- John Coggeshall http://www

Re: [PHP-DEV] New construct discussion Summary

2004-07-12 Thread Marc Richards
Marc Richards wrote: I also think that what Rasmus suggeted is a good idea: "So, perhaps introduce the value() function which doesn't do any type casting and enhance the intval(), strval() and floatval() functions to act like value() but cast appropriately unless the default arg is returned." I

Re: [PHP-DEV] New construct discussion Summary

2004-07-12 Thread Marc Richards
Jason Garber wrote: MR> $level = value($_POST['level'], NULL, INT); MR> switch($level){ MR> case 0: MR> echo "Welcome to level 0"; MR> break; MR> case 1: MR> echo "Welcome to level 1"; MR> break; MR> case 2: MR> echo "Welcome to level 2"; MR> break; MR> default: MR> echo "

Re: [PHP-DEV] New construct discussion Summary

2004-07-12 Thread Curt Zirzow
* Thus wrote Rasmus Lerdorf: > > So, perhaps introduce the value() function which doesn't do any type > casting and enhance the intval(), strval() and floatval() functions to act > like value() but cast appropriately unless the default arg is returned. > To retain backward compatibility the intval

Re: [PHP-DEV] New construct discussion Summary

2004-07-12 Thread Jason Garber
MR> $level = value($_POST['level'], NULL, INT); MR> switch($level){ MR> case 0: MR> echo "Welcome to level 0"; MR> break; MR> case 1: MR> echo "Welcome to level 1"; MR> break; MR> case 2: MR> echo "Welcome to level 2"; MR> break; MR> default: MR> echo "That level is in

Re: [PHP-DEV] New construct discussion Summary

2004-07-12 Thread Marc Richards
Jason Garber wrote: Sunday, July 11, 2004, 10:48:06 PM, you wrote: RL> On Sun, 11 Jul 2004, Jason Garber wrote: The concept is desirable, but can be achieved if you need it just as simply using already available syntax (ie a cast): $level = (integer) value($_SESSION['level'], 1); RL> The problem

Re: [PHP-DEV] New construct discussion Summary (was: what happened to that new isset() like language construct)

2004-07-12 Thread Andi Gutmans
It's a reserved word so I doubt it'll break scripts. Andi At 05:37 PM 7/12/2004 +0200, Marcus Boerger wrote: Hello Derick, Monday, July 12, 2004, 11:21:06 AM, you wrote: > On Mon, 12 Jul 2004, Sebastian Bergmann wrote: >> Andi Gutmans wrote: >> > How about default($var, expr)? >> >> It might be a

Re: [PHP-DEV] New construct discussion Summary (was: what happened to that new isset() like language construct)

2004-07-12 Thread Marcus Boerger
Hello George, Monday, July 12, 2004, 6:36:22 PM, you wrote: > On Jul 12, 2004, at 11:37 AM, Marcus Boerger wrote: >> Hello Derick, >> >> Monday, July 12, 2004, 11:21:06 AM, you wrote: >> >>> Agreed, and I also like default() >> >> The problem with default() is that there will be tons of scripts

Re: [PHP-DEV] New construct discussion Summary (was: what happened to that new isset() like language construct)

2004-07-12 Thread Jason Garber
>> >> The problem with default() is that there will be tons of scripts out >> there >> that will be broken by this. Hence i'd like to see a more non intuitive >> name (like the ifsetor). Probably getvalue() was the best compromise so >> far. GS> what was wrong with nvl() (of oracle fame)? ifset(

Re: [PHP-DEV] New construct discussion Summary (was: what happened to that new isset() like language construct)

2004-07-12 Thread George Schlossnagle
On Jul 12, 2004, at 11:37 AM, Marcus Boerger wrote: Hello Derick, Monday, July 12, 2004, 11:21:06 AM, you wrote: Agreed, and I also like default() The problem with default() is that there will be tons of scripts out there that will be broken by this. Hence i'd like to see a more non intuitive name

Re: [PHP-DEV] New construct discussion Summary (was: what happened to that new isset() like language construct)

2004-07-12 Thread Marcus Boerger
Hello Derick, Monday, July 12, 2004, 11:21:06 AM, you wrote: > On Mon, 12 Jul 2004, Sebastian Bergmann wrote: >> Andi Gutmans wrote: >> > How about default($var, expr)? >> >> It might be a good idea to decide on a name for the construct before >> the PHP 5.0.0 release in order to make it a r

Re: [PHP-DEV] New construct discussion Summary (was: what happened to that new isset() like language construct)

2004-07-12 Thread Derick Rethans
On Mon, 12 Jul 2004, l0t3k wrote: > > "Andi Gutmans" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > How about default($var, expr)? > my only reservation is that "default" is already part of a language > construct : ... > i'd say use defaultvalue Too long IMO. Derick -- PHP

Re: [PHP-DEV] New construct discussion Summary (was: what happened to that new isset() like language construct)

2004-07-12 Thread l0t3k
"Andi Gutmans" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > How about default($var, expr)? my only reservation is that "default" is already part of a language construct : switch ($param = $_GET["param"]) { case "foo" : bar(); break; case "this" : that();

Re: [PHP-DEV] New construct discussion Summary (was: what happened to that new isset() like language construct)

2004-07-12 Thread Derick Rethans
On Mon, 12 Jul 2004, Sebastian Bergmann wrote: > Andi Gutmans wrote: > > How about default($var, expr)? > > It might be a good idea to decide on a name for the construct before > the PHP 5.0.0 release in order to make it a reserved word (marked for > future use). Agreed, and I also like def

Re: [PHP-DEV] New construct discussion Summary (was: what happened to that new isset() like language construct)

2004-07-11 Thread Sebastian Bergmann
Andi Gutmans wrote: How about default($var, expr)? It might be a good idea to decide on a name for the construct before the PHP 5.0.0 release in order to make it a reserved word (marked for future use). -- Sebastian Bergmann http://sebastian-bergmann.de/ http://phpOpenTracker.d

Re: [PHP-DEV] New construct discussion Summary (was: what happened to that new isset() like language construct)

2004-07-11 Thread Jason Garber
AG> How about default($var, expr)? I like it. -Jason -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] New construct discussion Summary (was: what happened to that new isset() like language construct)

2004-07-11 Thread Andi Gutmans
How about default($var, expr)? Andi At 09:43 AM 7/11/2004 -0700, Rasmus Lerdorf wrote: On Sun, 11 Jul 2004, Marcus Boerger wrote: > $a = ifsetor($_GET['index'], $default); ifsetor() sounds a bit cumbersome to me. Some other suggestions: $a = is($_GET['index'], $default); $a = isor($_GET['

Re: [PHP-DEV] New construct discussion Summary

2004-07-11 Thread Rasmus Lerdorf
On Sun, 11 Jul 2004, Marc Richards wrote: > Marc Richards wrote: > > > I don't think a function named param() really fits, but I do like the > > idea of adding a type check (or in the case of PHP a type cast) to the > > function. > > > > > > $level = (int) (isset($_SESSION['level']) ? $_SESSION['l

Re: [PHP-DEV] New construct discussion Summary

2004-07-11 Thread Marc Richards
Marc Richards wrote: I don't think a function named param() really fits, but I do like the idea of adding a type check (or in the case of PHP a type cast) to the function. $level = (int) (isset($_SESSION['level']) ? $_SESSION['level'] : (isset($_REQUEST['level']) ? $_REQUEST['level'] : 1)) bec

Re: [PHP-DEV] New construct discussion Summary

2004-07-11 Thread Marc Richards
Sean Coates wrote: Not meaning to add more confusion, but Coldfusion (yes yes, please keep laughter to a minimum) has had a similar function since the beginning (IIRC). it's http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/tags-b13.htm Perhaps a php function "param(...)" ? Even though it'

Re: [PHP-DEV] New construct discussion Summary (was: what happened to that new isset() like language construct)

2004-07-11 Thread Curt Zirzow
* Thus wrote Rasmus Lerdorf: > On Sun, 11 Jul 2004, Marcus Boerger wrote: > > > $a = ifsetor($_GET['index'], $default); > > ifsetor() sounds a bit cumbersome to me. > > ... > > $a = value($_GET['index'], $default); I like value() although it might be a bit too generic, maybe add a word t

Re: Re: [PHP-DEV] New construct discussion Summary (was: what happened to that new isset() like language construct)

2004-07-11 Thread Sterling Hughes
On Sun, 11 Jul 2004 09:43:51 -0700 (PDT), Rasmus Lerdorf <[EMAIL PROTECTED]> wrote: > On Sun, 11 Jul 2004, Marcus Boerger wrote: > > > $a = ifsetor($_GET['index'], $default); > > ifsetor() sounds a bit cumbersome to me. > > Some other suggestions: > > $a = is($_GET['index'], $default); >

Re: [PHP-DEV] New construct discussion Summary

2004-07-11 Thread Sean Coates
Not meaning to add more confusion, but Coldfusion (yes yes, please keep laughter to a minimum) has had a similar function since the beginning (IIRC). it's http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/tags-b13.htm Perhaps a php function "param(...)" ? Even though it's not always a req

Re: [PHP-DEV] New construct discussion Summary

2004-07-11 Thread Marc Richards
Ilya Sher wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 firstset() is most logical name (at least for me) | The problem with firstset() is that it doesn't make as much sense if we are only testing one variable...but that is still to be determined. Marc -- PHP Internals - PHP Runtime Devel

Re: [PHP-DEV] New construct discussion Summary (was: what happened to that new isset() like language construct)

2004-07-11 Thread Rasmus Lerdorf
On Sun, 11 Jul 2004, Marcus Boerger wrote: > $a = ifsetor($_GET['index'], $default); ifsetor() sounds a bit cumbersome to me. Some other suggestions: $a = is($_GET['index'], $default); $a = isor($_GET['index'], $default); $a = valid($_GET['index'], $default); $a = value($_G

Re: [PHP-DEV] New construct discussion Summary (was: what happened to that new isset() like language construct)

2004-07-11 Thread Marcus Boerger
Hello Marc, Sunday, July 11, 2004, 4:49:57 AM, you wrote: > Ok, so let me try to do a little summary. > If and When > --- > 1) There seems to be a general consensus that this feature should be > implemented in SOME way. > 2) It was too late for 5.0.0 so it will be targeted for 5.1 >

Re: [PHP-DEV] New construct discussion Summary

2004-07-11 Thread Cris H
--- Marc Richards <[EMAIL PROTECTED]> wrote: > 3) So this leaves a function call which begs two questions: > What do we call it, [snip] > These include: ifset(), ifelse(), ifexists() and [snip] > nvl(), ifnull() and coalesce() have been proposed because of > This currently leaves us with a hand ful

Re: [PHP-DEV] New construct discussion Summary

2004-07-11 Thread Ilya Sher
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Marc Richards wrote: | Ok, so let me try to do a little summary. | | | If and When | --- | 1) There seems to be a general consensus that this feature should be | implemented in SOME way. | 2) It was too late for 5.0.0 so it will be targeted for