Re: [PHP4BETA] Is this a good idea for an operator?
| From: | Unknown Sender | Date: | Tue, 03 Aug 1999 12:03:28 +0000 |
| Subject: | Re: [PHP4BETA] Is this a good idea for an operator? | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-3062@lists.php.net to get a copy of this message | ||
On Tue, 3 Aug 1999, Michael Stearne wrote:
}if ($action == ("||","modify", "create", "delete")) {
}
}if ($action == ("&&","modify", "create", "delete"))
{
}
}if ($action != ("&&","modify", "create", "delete"))
{
Hm, I think, this is too complicated. Even in the view of how to program
this into PHP.
Why not a function, which will do all this? comp or mcomp or multicompare
if ( comp($action,'||',ARRAY(modify,create,delete)) ) {
Think this is a clean and lean syntax, which does not introduce too much
new things.
BTW: For myself I would wish a abreviation for ARRAY(). [()] or <()> for
example. I also would prefer this, cause it makes clear, that this is not
a function, but a language construct. Perhaps a general syntax for using a
language (array-)construct?
[(a,b,c)] ~ ARRAY(a,b,c)
[each $bla] ~ each($bla)
[list $a,$b,$c] ~ list($a,$b,$c)
...
Example:
$bla= [( a=>bla, b=>hugo, c=>hugobla )];
while ( [list $key,$val] = [each $bla] ) {
}
The example above will look then like
if ( comp($action,'||',[(modify,create,delete)] ) ) {
--
SSilk - Alexander Aulbach - Herbipolis/Frankonia Minoris - (0931)22032