FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Operator precedence
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Operator precedence [message #185014 is a reply to message #185013] Mon, 24 February 2014 02:09 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 2/23/2014 6:36 PM, Richard Damon wrote:
> On 2/23/14, 4:34 PM, Jerry Stuckle wrote:
>> On 2/23/2014 2:42 PM, GS wrote:
>>> This shows one of the major problems with PHP: there is no formal
>>> language
>>> definition, you have to go by examples in the help file to intuit what is
>>> or is not valid. Where is the BNF definition of the language? There is
>>> none
>>> AFAICT.
>>>
>>
>> Incorrect. There is a formal definition, as indicated in the doc at
>> www.php.net.
>>
> Do you have a pointer to where "expression" is precisely defined (other
> than reading code).
>

Try any Introduction to Programming book. Documentation (not just PHP)
does not normally define commonly used terms.

Do you expect it to define terms such as "program", "web", and such, also?

"Expression" is used in almost every programming language around.

> A statement in the documentation says:
>
> PHP provides a full and powerful implementation of expressions, and
> documenting it entirely goes beyond the scope of this manual.
>

That is correct.

> Note that this is the "Language Reference" under "Expressions", if that
> isn't the right spot to formally define the term (or at least place a
> pointer to the formal definition), I am not sure what would be.
>
> This shows that PHP is not a "formally defined language".
>

According to you, the documentation should also define "Language",
"full", "Powerful", "Implementation"...

> That doesn't mean it isn't powerful, or useful, or the right tool to use
> in some places, but does say that it lacks some formal rigor.
>

Once again, incorrect.

> The lack of formal rigor says that there are some questions which just
> can't be answered by reading the language documentation.
>

It can if you have a basic understanding of programming.

> The original question was a good example of this. the assignment
> operator is described as having a precedence (fairly low) just like all
> other operators, with some vague comments that it is done in a way that
> certain things just work. In comments on looking at the code, the left
> operand of assignment is a variable, and not an expression, effectively
> giving assignment a very high precedence to the left, and a very low
> precedence to the right (if the grammar even does end up being actually
> describable precisely with precedence). To my knowledge, this detail is
> NOT formally presented in the documentation.
>

No, the original question shows a basic lack of knowledge of terms used
in programming. As does your argument.

> This is somewhat the result of the type of language PHP is. PHP is
> inherently a "single source" language, there is one implementation, and
> that ultimately is the definition of what the language is (for that
> version). This is as opposed to a language like C, where there is a
> formal spec for the language, and many people can write their own
> implementation, and that implementation can be judged by if it fully
> meets the specification or not.
>

It has NOTHING to do with PHP being a "single source" language. It has
EVERYTHING to do with your lack of knowledge of basic programming terms.

> I am NOT proposing the PHP should stop and go to the effort to build a
> standard of the level of C and the like, it isn't used as that type of
> language. It might not hurt to "back-port" some of the details of
> grammar as parsed, into an appendix.
>

PHP is well documented with a formal rigor, as indicated in the manual.
Your lack of knowledge is not PHP's problem.

--
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex(at)attglobal(dot)net
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Correlating curl resources to some other object.
Next Topic: Experienced Web designer required
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri May 10 00:11:15 GMT 2024

Total time taken to generate the page: 0.04886 seconds