Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #2565 > unrolled thread

error message I don understand

Started by"liebling.kreuzberg@gmail.com" <liebling.kreuzberg@gmail.com>
First post2011-07-15 14:38 +0000
Last post2011-07-18 21:29 +0200
Articles 20 on this page of 54 — 13 participants

Back to article view | Back to comp.lang.php


Contents

  error message I don understand "liebling.kreuzberg@gmail.com" <liebling.kreuzberg@gmail.com> - 2011-07-15 14:38 +0000
    Re: error message I don understand Billy Mays <81282ed9a88799d21e77957df2d84bd6514d9af6@myhashismyemail.com> - 2011-07-15 10:44 -0400
      Re: error message I don understand "liebling.kreuzberg@gmail.com" <liebling.kreuzberg@gmail.com> - 2011-07-15 17:26 +0000
        Re: error message I don understand The Natural Philosopher <tnp@invalid.invalid> - 2011-07-15 18:45 +0100
          Re: error message I don understand "liebling.kreuzberg@gmail.com" <liebling.kreuzberg@gmail.com> - 2011-07-15 18:36 +0000
            Re: error message I don understand VanguardLH <V@nguard.LH> - 2011-07-15 14:25 -0500
              Re: error message I don understand The Natural Philosopher <tnp@invalid.invalid> - 2011-07-15 21:36 +0100
                Re: error message I don understand "liebling.kreuzberg@gmail.com" <liebling.kreuzberg@gmail.com> - 2011-07-16 09:17 +0000
                  Re: error message I don understand The Natural Philosopher <tnp@invalid.invalid> - 2011-07-16 13:52 +0100
                Re: error message I don understand Heinrich Käsner <heinkasner@gmail.com> - 2011-08-02 07:02 -0700
            Re: error message I don understand The Natural Philosopher <tnp@invalid.invalid> - 2011-07-15 21:35 +0100
            Re: error message I don understand Jerry Stuckle <jstucklex@attglobal.net> - 2011-07-16 09:30 -0400
              Re: error message I don understand "liebling.kreuzberg@gmail.com" <liebling.kreuzberg@gmail.com> - 2011-07-16 19:14 +0000
                Re: error message I don understand The Natural Philosopher <tnp@invalid.invalid> - 2011-07-16 22:18 +0100
    Re: error message I don understand The Natural Philosopher <tnp@invalid.invalid> - 2011-07-15 17:49 +0100
      Re: error message I don understand "liebling.kreuzberg@gmail.com" <liebling.kreuzberg@gmail.com> - 2011-07-15 17:25 +0000
    Re: error message I don understand Denis McMahon <denis.m.f.mcmahon@gmail.com> - 2011-07-16 19:28 +0000
      Re: error message I don understand "liebling.kreuzberg@gmail.com" <liebling.kreuzberg@gmail.com> - 2011-07-17 08:21 +0000
        Re: error message I don understand Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-07-17 11:10 +0200
          Re: error message I don understand The Natural Philosopher <tnp@invalid.invalid> - 2011-07-17 10:20 +0100
            Re: error message I don understand Jerry Stuckle <jstucklex@attglobal.net> - 2011-07-17 09:01 -0400
          Re: error message I don understand Jerry Stuckle <jstucklex@attglobal.net> - 2011-07-17 09:00 -0400
            Re: error message I don understand Denis McMahon <denis.m.f.mcmahon@gmail.com> - 2011-07-17 14:53 +0000
              Re: error message I don understand dougatmilmacdotcom@example.com (Doug Miller) - 2011-07-17 16:26 +0000
              Re: error message I don understand "liebling.kreuzberg@gmail.com" <liebling.kreuzberg@gmail.com> - 2011-07-18 16:11 +0000
          Re: error message I don understand Denis McMahon <denis.m.f.mcmahon@gmail.com> - 2011-07-17 14:52 +0000
            Re: error message I don understand Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-07-18 17:19 +0200
              Re: error message I don understand The Natural Philosopher <tnp@invalid.invalid> - 2011-07-18 17:01 +0100
          Re: error message I don understand "liebling.kreuzberg@gmail.com" <liebling.kreuzberg@gmail.com> - 2011-07-18 16:07 +0000
            Re: error message I don understand Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-07-18 18:27 +0200
              Re: error message I don understand "liebling.kreuzberg@gmail.com" <liebling.kreuzberg@gmail.com> - 2011-07-18 20:12 +0000
    Re: error message I don understand August Karlstrom <fusionfile@gmail.com> - 2011-07-17 14:55 +0200
      Re: error message I don understand Jerry Stuckle <jstucklex@attglobal.net> - 2011-07-17 09:03 -0400
        Re: error message I don understand August Karlstrom <fusionfile@gmail.com> - 2011-07-17 16:50 +0200
          Re: error message I don understand Jerry Stuckle <jstucklex@attglobal.net> - 2011-07-17 12:26 -0400
          Re: error message I don understand "Peter H. Coffin" <hellsop@ninehells.com> - 2011-07-17 11:31 -0500
            Nasty language semantics (Was: error message I don understand) August Karlstrom <fusionfile@gmail.com> - 2011-07-17 19:47 +0200
              Re: Nasty language semantics (Was: error message I don understand) Jerry Stuckle <jstucklex@attglobal.net> - 2011-07-17 14:12 -0400
              Re: Nasty language semantics (Was: error message I don understand) Robert Heller <heller@deepsoft.com> - 2011-07-17 13:26 -0500
              Re: Nasty language semantics (Was: error message I don understand) Tim Streater <timstreater@greenbee.net> - 2011-07-17 20:23 +0100
                Re: Nasty language semantics (Was: error message I don understand) The Natural Philosopher <tnp@invalid.invalid> - 2011-07-17 20:50 +0100
                  Re: Nasty language semantics (Was: error message I don understand) Robert Heller <heller@deepsoft.com> - 2011-07-17 15:17 -0500
                    Re: Nasty language semantics (Was: error message I don understand) The Natural Philosopher <tnp@invalid.invalid> - 2011-07-17 21:21 +0100
                    Re: Nasty language semantics Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-07-18 18:17 +0200
                  Re: Nasty language semantics (Was: error message I don understand) Tim Streater <timstreater@greenbee.net> - 2011-07-17 23:06 +0100
                    Re: Nasty language semantics (Was: error message I don understand) August Karlstrom <fusionfile@gmail.com> - 2011-07-18 00:48 +0200
                      Re: Nasty language semantics (Was: error message I don understand) Jerry Stuckle <jstucklex@attglobal.net> - 2011-07-17 19:23 -0400
                        Re: Nasty language semantics (Was: error message I don understand) August Karlstrom <fusionfile@gmail.com> - 2011-07-18 01:51 +0200
                          Re: Nasty language semantics (Was: error message I don understand) Jerry Stuckle <jstucklex@attglobal.net> - 2011-07-17 21:18 -0400
                      Re: Nasty language semantics (Was: error message I don understand) Tim Streater <timstreater@greenbee.net> - 2011-07-18 09:22 +0100
                        Re: Nasty language semantics (Was: error message I don understand) "Peter H. Coffin" <hellsop@ninehells.com> - 2011-07-18 10:57 -0500
          Re: error message I don understand Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-07-18 17:55 +0200
            Nasty language semantics (Was: error message I don understand) August Karlstrom <fusionfile@gmail.com> - 2011-07-18 20:31 +0200
              Re: Nasty language semantics Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-07-18 21:29 +0200

Page 2 of 3 — ← Prev page 1 [2] 3  Next page →


#2587

FromJerry Stuckle <jstucklex@attglobal.net>
Date2011-07-17 09:01 -0400
Message-ID<ivumfj$vlb$2@dont-email.me>
In reply to#2584
On 7/17/2011 5:20 AM, The Natural Philosopher wrote:
> Thomas 'PointedEars' Lahn wrote:
>> liebling.kreuzberg@gmail.com wrote:
>>
>>> Denis McMahon wrote:
>>>> Consider:
>>>>
>>>> <?php
>>>>
>>>> function x()
>>>> {
>>>> return 5;
>>>> }
>>>>
>>>> x() = 1;
>>>>
>>>> ?>
>>>>
>>>> although x() gives the value 5, it is not a variable that can be
>>>> set, and
>>>> so you can not assign (or write) a value (such as 1) to it.
>>>>
>>>> The php error message is saying that you can't assign (or write) a
>>>> value
>>>> to a function call, or in other words, the return value of a function
>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>> call is read_only data.
>> ^^^^^^^^^^^^^^^^^^^^^^^
>>> Thanks Dennis.
>>>
>>> Good addition to the explanation of Billy.
>>
>> In the end an oversimplified, wrong explanation. It is a syntactical
>> requirement, not a functional one:
>>
>> function x()
>> {
>> return array(23);
>> }
>>
>> $a = x();
>>
>> $a[0] = 42;
>>
>> /* * Array
>> * (
>> * [0] => 42 * )
>> */
>> print_r($a);
>>
>
> fair point, if pedantic.
>
>
>> You would be well-advised to post under your real name, as it is
>> customary in Usenet.
>>
>
> And have the Stuckle stalk you in real life?
>
> I think not.
>

LOL, are you hearing little voices in your head again?

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#2586

FromJerry Stuckle <jstucklex@attglobal.net>
Date2011-07-17 09:00 -0400
Message-ID<ivume9$vlb$1@dont-email.me>
In reply to#2583
On 7/17/2011 5:10 AM, Thomas 'PointedEars' Lahn wrote:
> liebling.kreuzberg@gmail.com wrote:
>
>> Denis McMahon wrote:
>>> Consider:
>>>
>>> <?php
>>>
>>> function x()
>>>    {
>>>    return 5;
>>>    }
>>>
>>> x() = 1;
>>>
>>> ?>
>>>
>>> although x() gives the value 5, it is not a variable that can be set, and
>>> so you can not assign (or write) a value (such as 1) to it.
>>>
>>> The php error message is saying that you can't assign (or write) a value
>>> to a function call, or in other words, the return value of a function
>                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>> call is read_only data.
>     ^^^^^^^^^^^^^^^^^^^^^^^
>> Thanks Dennis.
>>
>> Good addition to the explanation of Billy.
>
> In the end an oversimplified, wrong explanation.  It is a syntactical
> requirement, not a functional one:
>
>    function x()
>    {
>      return array(23);
>    }
>
>    $a = x();
>
>    $a[0] = 42;
>
>    /*
>     * Array
>     * (
>     *   [0] =>  42
>     * )
>     */
>    print_r($a);
>
> You would be well-advised to post under your real name, as it is customary
> in Usenet.
>
>
> PointedEars

Which has absolutely nothing to do with the problem the op had, or with 
Dennis's explanation (which, btw, is one of the better ones I've seen 
for this particular problem).

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#2592

FromDenis McMahon <denis.m.f.mcmahon@gmail.com>
Date2011-07-17 14:53 +0000
Message-ID<4e22f778$0$19167$a8266bb1@newsreader.readnews.com>
In reply to#2586
On Sun, 17 Jul 2011 09:00:53 -0400, Jerry Stuckle wrote:

> Which has absolutely nothing to do with the problem the op had, or with
> Dennis's explanation (which, btw, is one of the better ones I've seen
> for this particular problem).

Yeah, well part of what I was doing was trying to explain to the OP why 
PHP expresses the error in english the way it does, given that the OP 
might not be a native english speaker.

It's very easy sometimes for us who are generally working with IT in our 
native languages to remember that for a lot of people, when they get an 
error message, their first problem with understanding the error is that 
they have to translate the error message into their own language, and 
things can get obscured by the translation.

I'm sure I'm not the only one who would love to see T'PE'L give an 
explanation for the OPs original error message, but I've noticed that he 
seems to prefer making disparaging comments about other people's 
solutions and comments rather than making any contributions of his own, 
and on the rare occasions he does contribute, mostly he posts links to 
other people's work.

I did see his attempt to correct me, but what he demonstrates is not what 
I said can't be done. Looks like he has comprehension as well as semantic 
issues ... 

Rgds

Denis McMahon

[toc] | [prev] | [next] | [standalone]


#2594

Fromdougatmilmacdotcom@example.com (Doug Miller)
Date2011-07-17 16:26 +0000
Message-ID<ivv2ff$c18$1@dont-email.me>
In reply to#2592
In article <4e22f778$0$19167$a8266bb1@newsreader.readnews.com>, Denis McMahon <denis.m.f.mcmahon@gmail.com> wrote:

>I'm sure I'm not the only one who would love to see T'PE'L give an 
>explanation for the OPs original error message, but I've noticed that he 
>seems to prefer making disparaging comments about other people's 
>solutions and comments rather than making any contributions of his own, 
>and on the rare occasions he does contribute, mostly he posts links to 
>other people's work.
>
>I did see his attempt to correct me, but what he demonstrates is not what 
>I said can't be done. Looks like he has comprehension as well as semantic 
>issues ... 

English is not PointedHead's first language. And, although he can write 
it fairly well, he does not understand it as well as he thinks he does.

[toc] | [prev] | [next] | [standalone]


#2618

From"liebling.kreuzberg@gmail.com" <liebling.kreuzberg@gmail.com>
Date2011-07-18 16:11 +0000
Message-ID<4e245b36$0$250$dbd41001@news.wanadoo.nl>
In reply to#2592
Denis McMahon wrote:

> On Sun, 17 Jul 2011 09:00:53 -0400, Jerry Stuckle wrote:
>
>> Which has absolutely nothing to do with the problem the op had, or with
>> Dennis's explanation (which, btw, is one of the better ones I've seen
>> for this particular problem).
>
> Yeah, well part of what I was doing was trying to explain to the OP why 
> PHP expresses the error in english the way it does, given that the OP 
> might not be a native english speaker.
>
> It's very easy sometimes for us who are generally working with IT in our 
> native languages to remember that for a lot of people, when they get an 
> error message, their first problem with understanding the error is that 
> they have to translate the error message into their own language, and 
> things can get obscured by the translation.
>
> I'm sure I'm not the only one who would love to see T'PE'L give an 
> explanation for the OPs original error message, but I've noticed that he 
> seems to prefer making disparaging comments about other people's 
> solutions and comments rather than making any contributions of his own, 
> and on the rare occasions he does contribute, mostly he posts links to 
> other people's work.
>
> I did see his attempt to correct me, but what he demonstrates is not what 
> I said can't be done. Looks like he has comprehension as well as semantic 
> issues ... 
>
> Rgds
>
> Denis McMahon

Dennis:

Paragraph 1: you're absolutely right. My mothertongue is Dutch. (For the
others: try that one).

Paragraph 2: You're right again. I do need sometimes to translate to
understand the meaning of the error message. On the other hand, since
I'm able to define my own variables in MY language my variables seldom
confuse me.

Paragraph 3: I didn notice this, due to the short term I read here (a
few weeks).

BR, Schimanski.

[toc] | [prev] | [next] | [standalone]


#2590

FromDenis McMahon <denis.m.f.mcmahon@gmail.com>
Date2011-07-17 14:52 +0000
Message-ID<4e22f737$0$19237$a8266bb1@newsreader.readnews.com>
In reply to#2583
On Sun, 17 Jul 2011 11:10:30 +0200, Thomas 'PointedEars' Lahn wrote:

> In the end an oversimplified, wrong explanation.  It is a syntactical
> requirement, not a functional one:

>   $a = x();

Here you're assigning the return value of the function x() to the 
variable $a.

>   $a[0] = 42;

Here you're writing to the variable $a (or rather, in this case, to an 
element of the array that is variable $a).

Neither of these is trying to assign (write) a value to the return value 
of the function call. Whether you call the issue syntactical or not is 
just irrelevant and messing about with semantics.

Rgds

Denis McMahon

[toc] | [prev] | [next] | [standalone]


#2614

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2011-07-18 17:19 +0200
Message-ID<2977017.SPkdTlGXAF@PointedEars.de>
In reply to#2590
Denis McMahon wrote:

> Thomas 'PointedEars' Lahn wrote:
>> In the end an oversimplified, wrong explanation.  It is a syntactical
>> requirement, not a functional one:
>> 
>>   $a = x();
> 
> Here you're assigning the return value of the function x() to the
> variable $a.
> 
>>   $a[0] = 42;
> 
> Here you're writing to the variable $a (or rather, in this case, to an
> element of the array that is variable $a).
> 
> Neither of these is trying to assign (write) a value to the return value
> of the function call.

Yes, it is.  The return value of the function is a one-element array, and 
with that assignment I am writing to the same memory area (or another memory 
area that holds a copy of the former's content) by changing the first 
element of the array.  IOW, the return value is _not_ read-only.

> Whether you call the issue syntactical or not is just irrelevant and
> messing about with semantics.

You are mistaken.  The issue is a syntactical one, not a functional one, 
because a function call (currently) cannot occur on the left-hand side of an 
assignment expression in PHP, *regardless* of the return value of function 
to be called.

IOW, it does not make sense to say that "the return value is read-only" as 
the function is *never* *called* and *no* return value is obtained in the 
first place then.  This is a rather important difference because syntax 
errors are detected by the parser upon (JIT-)compilation already.


PointedEars
-- 
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee

[toc] | [prev] | [next] | [standalone]


#2616

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2011-07-18 17:01 +0100
Message-ID<j01ldb$et1$5@news.albasani.net>
In reply to#2614
Thomas 'PointedEars' Lahn wrote:
> Denis McMahon wrote:
> 
>> Thomas 'PointedEars' Lahn wrote:
>>> In the end an oversimplified, wrong explanation.  It is a syntactical
>>> requirement, not a functional one:
>>>
>>>   $a = x();
>> Here you're assigning the return value of the function x() to the
>> variable $a.
>>
>>>   $a[0] = 42;
>> Here you're writing to the variable $a (or rather, in this case, to an
>> element of the array that is variable $a).
>>
>> Neither of these is trying to assign (write) a value to the return value
>> of the function call.
> 
> Yes, it is.  The return value of the function is a one-element array, and 
> with that assignment I am writing to the same memory area (or another memory 
> area that holds a copy of the former's content) by changing the first 
> element of the array.  IOW, the return value is _not_ read-only.
> 
>> Whether you call the issue syntactical or not is just irrelevant and
>> messing about with semantics.
> 
> You are mistaken.  The issue is a syntactical one, not a functional one, 
> because a function call (currently) cannot occur on the left-hand side of an 
> assignment expression in PHP, *regardless* of the return value of function 
> to be called.
> 

so you are saying that (x())[3]=7; is not allowable?

> IOW, it does not make sense to say that "the return value is read-only" as 
> the function is *never* *called* and *no* return value is obtained in the 
> first place then.  This is a rather important difference because syntax 
> errors are detected by the parser upon (JIT-)compilation already.
> 
> 
> PointedEars

[toc] | [prev] | [next] | [standalone]


#2617

From"liebling.kreuzberg@gmail.com" <liebling.kreuzberg@gmail.com>
Date2011-07-18 16:07 +0000
Message-ID<4e245a27$0$236$dbd41001@news.wanadoo.nl>
In reply to#2583
Thomas 'PointedEars' Lahn wrote:

> liebling.kreuzberg@gmail.com wrote:
>
>> Denis McMahon wrote:
>>> Consider:
>>>
>>> <?php
>>>
>>> function x()
>>>   {
>>>   return 5;
>>>   }
>>>
>>> x() = 1;
>>>
>>> ?>
>>>
>>> although x() gives the value 5, it is not a variable that can be set, and
>>> so you can not assign (or write) a value (such as 1) to it.
>>>
>>> The php error message is saying that you can't assign (or write) a value
>>> to a function call, or in other words, the return value of a function
>                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>> call is read_only data.
>    ^^^^^^^^^^^^^^^^^^^^^^^
>> Thanks Dennis.
>> 
>> Good addition to the explanation of Billy.
>
> In the end an oversimplified, wrong explanation.  It is a syntactical 
> requirement, not a functional one:
>
>   function x()
>   {
>     return array(23);
>   }
>
>   $a = x();
>
>   $a[0] = 42;
>
>   /* 
>    * Array
>    * (
>    *   [0] => 42  
>    * )
>    */
>   print_r($a);
>
> You would be well-advised to post under your real name, as it is customary 
> in Usenet.
>
>
> PointedEars

Please leave the name I use to post with my responsibility.

I use a nickname and a REAL address as you can test.

Ohhh, what was your name? PointedEars? Ahhh, got it.

BR, Schimanski.

[toc] | [prev] | [next] | [standalone]


#2621

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2011-07-18 18:27 +0200
Message-ID<4737098.ypaU67uLZW@PointedEars.de>
In reply to#2617
liebling.kreuzberg@gmail.com wrote:

> Please leave the name I use to post with my responsibility.

If you leave me (and several others) the right to ignore you from now on …
 
> I use a nickname and a REAL address as you can test.

Your From *address* is not at issue.

> Ohhh, what was your name? PointedEars?

No, that is my nickname, to be found both in my signature and between my 
first and last name in the From header.  Which you could have noticed if
you were seriously interested in learning something here.

> Ahhh, got it.

I don't think so.  You did not even consider my correction, so it would 
seem, unfortunately, that I am wasting my time with you.


Score adjusted

PointedEars
-- 
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
  -- Richard Cornford, cljs, <f806at$ail$1$8300dec7@news.demon.co.uk>

[toc] | [prev] | [next] | [standalone]


#2624

From"liebling.kreuzberg@gmail.com" <liebling.kreuzberg@gmail.com>
Date2011-07-18 20:12 +0000
Message-ID<4e2493b2$0$48989$dbd4f001@news.wanadoo.nl>
In reply to#2621
Thomas 'PointedEars' Lahn wrote:

> liebling.kreuzberg@gmail.com wrote:
>
>> Please leave the name I use to post with my responsibility.
>
> If you leave me (and several others) the right to ignore you from now on …
>  
>> I use a nickname and a REAL address as you can test.
>
> Your From *address* is not at issue.
>
>> Ohhh, what was your name? PointedEars?
>
> No, that is my nickname, to be found both in my signature and between my 
> first and last name in the From header.  Which you could have noticed if
> you were seriously interested in learning something here.
>
>> Ahhh, got it.
>
> I don't think so.  You did not even consider my correction, so it would 
> seem, unfortunately, that I am wasting my time with you.
>
>
> Score adjusted
>
> PointedEars

Please, than do just that. Ignore me. The rest can decide for
themselves.

[toc] | [prev] | [next] | [standalone]


#2585

FromAugust Karlstrom <fusionfile@gmail.com>
Date2011-07-17 14:55 +0200
Message-ID<ivum48$uri$1@dont-email.me>
In reply to#2565
On 2011-07-15 16:38, liebling.kreuzberg@gmail.com wrote:
> Hello group,
>
> I'm doing some php programming on my own webserver.
>
> I get the error message: PHP Fatal error:  Can't use function return
> value in write context in line 69
>
> This is line 69:  if (mysqli_num_rows($sDBResultaat) = 1 )
>
> Either I don see what I'm doing wrong or I interpret the message wrong.
> Either way I don't understand, can somebody point me the right way?
>
> Thanks in advance, schimanski.

It is a very easy mistake to do if you are used to saner programming 
languages in which `=' has the standard mathematical meaning (this 
symbol has been used in mathematics to denote equality for some 500 years).

August

-- 
The competent programmer is fully aware of the limited size of his own 
skull. He therefore approaches his task with full humility, and avoids 
clever tricks like the plague. --Edsger Dijkstra

[toc] | [prev] | [next] | [standalone]


#2588

FromJerry Stuckle <jstucklex@attglobal.net>
Date2011-07-17 09:03 -0400
Message-ID<ivumit$vlb$3@dont-email.me>
In reply to#2585
On 7/17/2011 8:55 AM, August Karlstrom wrote:
> On 2011-07-15 16:38, liebling.kreuzberg@gmail.com wrote:
>> Hello group,
>>
>> I'm doing some php programming on my own webserver.
>>
>> I get the error message: PHP Fatal error: Can't use function return
>> value in write context in line 69
>>
>> This is line 69: if (mysqli_num_rows($sDBResultaat) = 1 )
>>
>> Either I don see what I'm doing wrong or I interpret the message wrong.
>> Either way I don't understand, can somebody point me the right way?
>>
>> Thanks in advance, schimanski.
>
> It is a very easy mistake to do if you are used to saner programming
> languages in which `=' has the standard mathematical meaning (this
> symbol has been used in mathematics to denote equality for some 500 years).
>
> August
>

This isn't mathematics - it is programming, as people have told you 
before.  If you want mathematics, get a chalkboard.

Please tell me in mathematics what the '*' sign means.  Or '^'?  Maybe '||'?

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#2591

FromAugust Karlstrom <fusionfile@gmail.com>
Date2011-07-17 16:50 +0200
Message-ID<ivusrk$a3c$1@dont-email.me>
In reply to#2588
On 2011-07-17 15:03, Jerry Stuckle wrote:
> On 7/17/2011 8:55 AM, August Karlstrom wrote:
>> It is a very easy mistake to do if you are used to saner programming
>> languages in which `=' has the standard mathematical meaning (this
>> symbol has been used in mathematics to denote equality for some 500
>> years).
>>
>> August
>>
>
> This isn't mathematics - it is programming, as people have told you
> before. If you want mathematics, get a chalkboard.

Don't be silly. There are several programming languages in which `=' 
denote (surprise) equality.

> Please tell me in mathematics what the '*' sign means. Or '^'? Maybe '||'?

You do not seem get my point. It is the practice of redefining the 
meaning of a well known symbol (=) where the original concept (equality) 
is still needed and therefor denoted by a different token (==) that I 
find a really bad idea.

August

-- 
The competent programmer is fully aware of the limited size of his own 
skull. He therefore approaches his task with full humility, and avoids 
clever tricks like the plague. --Edsger Dijkstra

[toc] | [prev] | [next] | [standalone]


#2593

FromJerry Stuckle <jstucklex@attglobal.net>
Date2011-07-17 12:26 -0400
Message-ID<ivv2ev$e1k$1@dont-email.me>
In reply to#2591
On 7/17/2011 10:50 AM, August Karlstrom wrote:
> On 2011-07-17 15:03, Jerry Stuckle wrote:
>> On 7/17/2011 8:55 AM, August Karlstrom wrote:
>>> It is a very easy mistake to do if you are used to saner programming
>>> languages in which `=' has the standard mathematical meaning (this
>>> symbol has been used in mathematics to denote equality for some 500
>>> years).
>>>
>>> August
>>>
>>
>> This isn't mathematics - it is programming, as people have told you
>> before. If you want mathematics, get a chalkboard.
>
> Don't be silly. There are several programming languages in which `='
> denote (surprise) equality.
>
>> Please tell me in mathematics what the '*' sign means. Or '^'? Maybe
>> '||'?
>
> You do not seem get my point. It is the practice of redefining the
> meaning of a well known symbol (=) where the original concept (equality)
> is still needed and therefor denoted by a different token (==) that I
> find a really bad idea.
>
> August
>

Sure I get your point.  And in many computer languages, '=' is an 
assignment operator.  I first learned this back in the 60's when I was 
using FORTRAN.  It has been that way for a long time, and many more 
languages use '=' for assignment than not.

But you completely missed my point.  This is not mathematics.  This is 
programming.  You don't like the language syntax?  You are free to 
create your own language.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#2595

From"Peter H. Coffin" <hellsop@ninehells.com>
Date2011-07-17 11:31 -0500
Message-ID<slrnj263jm.207.hellsop@nibelheim.ninehells.com>
In reply to#2591
On Sun, 17 Jul 2011 16:50:28 +0200, August Karlstrom wrote:

> On 2011-07-17 15:03, Jerry Stuckle wrote:
>
>> This isn't mathematics - it is programming, as people have told you
>> before. If you want mathematics, get a chalkboard.
>
> Don't be silly. There are several programming languages in which `='
> denote (surprise) equality.

Very few that use it alone. They may set the context with a previous
"LET" or "test" or a grouping indicator, or, if they don't, they have
very rigorous typing such that assignments are statements alone and do
NOT return anything that could possibly be used in a logical/comparative
way, not even a success or failure.

-- 
43. I will maintain a healthy amount of skepticism when I capture the 
    beautiful rebel and she claims she is attracted to my power and 
    good looks and will gladly betray her companions if I just let her 
    in on my plans. --Peter Anspach's Evil Overlord list

[toc] | [prev] | [next] | [standalone]


#2596 — Nasty language semantics (Was: error message I don understand)

FromAugust Karlstrom <fusionfile@gmail.com>
Date2011-07-17 19:47 +0200
SubjectNasty language semantics (Was: error message I don understand)
Message-ID<ivv775$egh$1@dont-email.me>
In reply to#2595
On 2011-07-17 18:31, Peter H. Coffin wrote:
> On Sun, 17 Jul 2011 16:50:28 +0200, August Karlstrom wrote:
>
>> On 2011-07-17 15:03, Jerry Stuckle wrote:
>>
>>> This isn't mathematics - it is programming, as people have told you
>>> before. If you want mathematics, get a chalkboard.
>>
>> Don't be silly. There are several programming languages in which `='
>> denote (surprise) equality.
>
> Very few that use it alone.

Pascal, Modula-2, Eiffel and Ada all use `=' for equality and `:=' for 
assignment.

> They may set the context with a previous
> "LET" or "test" or a grouping indicator, or, if they don't, they have
> very rigorous typing such that assignments are statements alone and do
> NOT return anything that could possibly be used in a logical/comparative
> way, not even a success or failure.

Yes, and for a good reason - the statement-expression separation (or 
maybe we should say side-effect free expressions) is related to the 
sound principle of command-query separation.

August

-- 
The competent programmer is fully aware of the limited size of his own 
skull. He therefore approaches his task with full humility, and avoids 
clever tricks like the plague. --Edsger Dijkstra

[toc] | [prev] | [next] | [standalone]


#2597 — Re: Nasty language semantics (Was: error message I don understand)

FromJerry Stuckle <jstucklex@attglobal.net>
Date2011-07-17 14:12 -0400
SubjectRe: Nasty language semantics (Was: error message I don understand)
Message-ID<ivv8m3$o6u$1@dont-email.me>
In reply to#2596
On 7/17/2011 1:47 PM, August Karlstrom wrote:
> On 2011-07-17 18:31, Peter H. Coffin wrote:
>> On Sun, 17 Jul 2011 16:50:28 +0200, August Karlstrom wrote:
>>
>>> On 2011-07-17 15:03, Jerry Stuckle wrote:
>>>
>>>> This isn't mathematics - it is programming, as people have told you
>>>> before. If you want mathematics, get a chalkboard.
>>>
>>> Don't be silly. There are several programming languages in which `='
>>> denote (surprise) equality.
>>
>> Very few that use it alone.
>
> Pascal, Modula-2, Eiffel and Ada all use `=' for equality and `:=' for
> assignment.
>

Yup, four little used languages use it.  Versus dozens of heavily used 
languages.

>> They may set the context with a previous
>> "LET" or "test" or a grouping indicator, or, if they don't, they have
>> very rigorous typing such that assignments are statements alone and do
>> NOT return anything that could possibly be used in a logical/comparative
>> way, not even a success or failure.
>
> Yes, and for a good reason - the statement-expression separation (or
> maybe we should say side-effect free expressions) is related to the
> sound principle of command-query separation.
>
> August
>

Yup, and you wonder why such languages are so seldom used - while others 
such as C, C++, Java and PHP are used much more than any of the ones you 
mentioned, at least in production?

As I said - you don't like the syntax, create your own language with 
whatever syntax you want.  No one is forcing you to use PHP or any other 
language with syntax you don't like.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#2598 — Re: Nasty language semantics (Was: error message I don understand)

FromRobert Heller <heller@deepsoft.com>
Date2011-07-17 13:26 -0500
SubjectRe: Nasty language semantics (Was: error message I don understand)
Message-ID<4IGdnU8WQ5T2tL7TnZ2dnUVZ_jKdnZ2d@posted.localnet>
In reply to#2596
At Sun, 17 Jul 2011 19:47:12 +0200 August Karlstrom <fusionfile@gmail.com> wrote:

> 
> On 2011-07-17 18:31, Peter H. Coffin wrote:
> > On Sun, 17 Jul 2011 16:50:28 +0200, August Karlstrom wrote:
> >
> >> On 2011-07-17 15:03, Jerry Stuckle wrote:
> >>
> >>> This isn't mathematics - it is programming, as people have told you
> >>> before. If you want mathematics, get a chalkboard.
> >>
> >> Don't be silly. There are several programming languages in which `='
> >> denote (surprise) equality.
> >
> > Very few that use it alone.
> 
> Pascal, Modula-2, Eiffel and Ada all use `=' for equality and `:=' for 
> assignment.

Also: don't forget Basic.  Basic uses '=' for both equality
AND assignment, but you cannot perform an assignment someplace where a
logical (or any other) expression might occur, so there is no ambiguity.

> 
> > They may set the context with a previous
> > "LET" or "test" or a grouping indicator, or, if they don't, they have
> > very rigorous typing such that assignments are statements alone and do
> > NOT return anything that could possibly be used in a logical/comparative
> > way, not even a success or failure.
> 
> Yes, and for a good reason - the statement-expression separation (or 
> maybe we should say side-effect free expressions) is related to the 
> sound principle of command-query separation.
> 

Also: C++ allows a function call that returns a reference on the
left side of an assignment.  This the statements:

int & something(int bar);

if (something(4) = 3) {
}

would NOT be an error, although it is not obvious what is going on. 

> August
> 

-- 
Robert Heller             -- 978-544-6933 / heller@deepsoft.com
Deepwoods Software        -- http://www.deepsoft.com/
()  ascii ribbon campaign -- against html e-mail
/\  www.asciiribbon.org   -- against proprietary attachments


                                                                                                                        

[toc] | [prev] | [next] | [standalone]


#2599 — Re: Nasty language semantics (Was: error message I don understand)

FromTim Streater <timstreater@greenbee.net>
Date2011-07-17 20:23 +0100
SubjectRe: Nasty language semantics (Was: error message I don understand)
Message-ID<timstreater-EA2F23.20233117072011@news.individual.net>
In reply to#2596
In article <ivv775$egh$1@dont-email.me>,
 August Karlstrom <fusionfile@gmail.com> wrote:

> On 2011-07-17 18:31, Peter H. Coffin wrote:
> > On Sun, 17 Jul 2011 16:50:28 +0200, August Karlstrom wrote:
> >
> >> On 2011-07-17 15:03, Jerry Stuckle wrote:
> >>
> >>> This isn't mathematics - it is programming, as people have told you
> >>> before. If you want mathematics, get a chalkboard.
> >>
> >> Don't be silly. There are several programming languages in which `='
> >> denote (surprise) equality.
> >
> > Very few that use it alone.
> 
> Pascal, Modula-2, Eiffel and Ada all use `=' for equality and `:=' for 
> assignment.

A good enough reason not to use these languages.

-- 
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted"  --  Bill of Rights 1689

[toc] | [prev] | [next] | [standalone]


Page 2 of 3 — ← Prev page 1 [2] 3  Next page →

Back to top | Article view | comp.lang.php


csiph-web