You are here: Re: php best practise « PHP Programming Language « IT news, forums, messages
Re: php best practise

Posted by David Haynes on 03/12/06 15:25

rlee0001 wrote:
> Gary,
>
> One thing about that is that it is counter-intuitive to read. For
> example you are not asking "if 'fred' equals your name..." but rather
> "if your name equals fred'...".
>
> That said, your method is a very practical solution to a common
> problem.
>
> In a way I kinda wish that the '=' operator worked like the ECHO
> construct in that you wouldn't be able to use it as a function. That
> way if your source tried to actually look at the result of an '='
> assignment a syntax error would occur (like the distinction between
> echo and print). The only side effect would be that you would be unable
> to chain assignments like this:
>
> a = b = c = d = 0;
>
> But an alternate method could be added to the language such as:
>
> (a, b, c, d) = 0;
>
> Which I think is actually used by LISP if I recall correctly.
>
> But of course I'm just dreaming/thinking out loud here. :o)
>
> -Robert
>

Why not change all the primitives to objects and then move the '='
operation to equal()? Then you could have:
$a->equal($b)

Or DEFINE the '=' to be '.equals.'? Then it would be:
$a .equals. $b

[Just joking. Programmers in other languages may recognize these.]

-david-

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация