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


Groups > comp.lang.javascript > #33861 > unrolled thread

Inserting a DIV inside another DIV

Started bybit-naughty@hotmail.com
First post2017-08-22 21:47 -0700
Last post2017-08-31 18:37 +0100
Articles 18 on this page of 58 — 11 participants

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


Contents

  Inserting a DIV inside another DIV bit-naughty@hotmail.com - 2017-08-22 21:47 -0700
    Re: Inserting a DIV inside another DIV "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-08-23 12:08 +0200
      Re: Inserting a DIV inside another DIV bit-naughty@hotmail.com - 2017-08-23 23:19 -0700
        Re: Inserting a DIV inside another DIV "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-08-24 08:58 +0200
          Re: Inserting a DIV inside another DIV Tim Streater <timstreater@greenbee.net> - 2017-08-24 08:55 +0100
          Re: Inserting a DIV inside another DIV bit-naughty@hotmail.com - 2017-08-24 23:16 -0700
            Re: Inserting a DIV inside another DIV tony@mountifield.org (Tony Mountifield) - 2017-08-25 09:04 +0000
              Re: Inserting a DIV inside another DIV John G Harris <niam@jghnorth.org.uk.invalid> - 2017-08-25 15:54 +0100
              Re: Inserting a DIV inside another DIV bit-naughty@hotmail.com - 2017-08-27 23:43 -0700
                Re: Inserting a DIV inside another DIV John G Harris <niam@jghnorth.org.uk.invalid> - 2017-08-28 11:04 +0100
                Re: Inserting a DIV inside another DIV Julio Di Egidio <julio@diegidio.name> - 2017-08-28 04:02 -0700
                  Re: Inserting a DIV inside another DIV "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2017-08-28 06:24 -0700
                    Re: Inserting a DIV inside another DIV Julio Di Egidio <julio@diegidio.name> - 2017-08-28 07:42 -0700
                      Re: Inserting a DIV inside another DIV "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2017-08-29 06:45 -0700
                  Re: Inserting a DIV inside another DIV John G Harris <niam@jghnorth.org.uk.invalid> - 2017-08-28 15:13 +0100
                    Re: Inserting a DIV inside another DIV Julio Di Egidio <julio@diegidio.name> - 2017-08-28 07:30 -0700
                      Re: Inserting a DIV inside another DIV John G Harris <niam@jghnorth.org.uk.invalid> - 2017-08-29 10:11 +0100
                        Re: Inserting a DIV inside another DIV "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2017-08-29 07:00 -0700
                          Re: Inserting a DIV inside another DIV John G Harris <niam@jghnorth.org.uk.invalid> - 2017-08-30 18:24 +0100
                      Re: Inserting a DIV inside another DIV "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2017-08-29 06:57 -0700
                    Re: Inserting a DIV inside another DIV "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2017-08-29 06:51 -0700
                  Re: Inserting a DIV inside another DIV bit-naughty@hotmail.com - 2017-09-02 11:18 -0700
                    Re: Inserting a DIV inside another DIV Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2017-09-11 19:57 -0300
                      Re: Inserting a DIV inside another DIV Julio Di Egidio <julio@diegidio.name> - 2017-09-12 05:30 -0700
                        Re: Inserting a DIV inside another DIV "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-09-12 14:37 +0200
                          Re: Inserting a DIV inside another DIV Julio Di Egidio <julio@diegidio.name> - 2017-09-12 06:15 -0700
                            Re: Inserting a DIV inside another DIV "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-09-12 15:44 +0200
                              Re: Inserting a DIV inside another DIV Tim Streater <timstreater@greenbee.net> - 2017-09-12 14:51 +0100
                                Re: Inserting a DIV inside another DIV "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-09-12 16:38 +0200
                                  Re: Inserting a DIV inside another DIV Tim Streater <timstreater@greenbee.net> - 2017-09-12 20:20 +0100
                                    Re: Inserting a DIV inside another DIV "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-09-13 18:47 +0200
                            Re: Inserting a DIV inside another DIV Joao Rodrigues <groups_jr-1@yahoo.com> - 2017-09-13 01:20 -0300
            Re: Inserting a DIV inside another DIV "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-08-25 14:33 +0200
            Re: Inserting a DIV inside another DIV Peter Flynn <peter@silmaril.ie> - 2017-08-26 21:21 +0100
              Re: Inserting a DIV inside another DIV Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-08-27 03:16 +0200
                Re: Inserting a DIV inside another DIV Peter Flynn <peter@silmaril.ie> - 2017-08-27 11:40 +0100
                  Re: Inserting a DIV inside another DIV Julio Di Egidio <julio@diegidio.name> - 2017-08-27 04:05 -0700
                  Re: Inserting a DIV inside another DIV Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-08-27 16:15 +0200
                    Re: Inserting a DIV inside another DIV Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-08-27 16:27 +0200
                    Re: Inserting a DIV inside another DIV Tim Streater <timstreater@greenbee.net> - 2017-08-27 15:42 +0100
              Re: Inserting a DIV inside another DIV John G Harris <niam@jghnorth.org.uk.invalid> - 2017-08-27 14:10 +0100
                Re: Inserting a DIV inside another DIV "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-08-27 15:40 +0200
                  Re: Inserting a DIV inside another DIV John G Harris <niam@jghnorth.org.uk.invalid> - 2017-08-28 10:50 +0100
                    Re: Inserting a DIV inside another DIV "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-08-28 22:35 +0200
                      Re: Inserting a DIV inside another DIV Tim Streater <timstreater@greenbee.net> - 2017-08-28 22:53 +0100
                        Re: Inserting a DIV inside another DIV "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-08-29 00:27 +0200
                          Re: Inserting a DIV inside another DIV John G Harris <niam@jghnorth.org.uk.invalid> - 2017-08-29 10:16 +0100
                            Re: Inserting a DIV inside another DIV "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-08-29 23:05 +0200
                              Re: Inserting a DIV inside another DIV Tim Streater <timstreater@greenbee.net> - 2017-08-29 22:51 +0100
                                Re: Inserting a DIV inside another DIV "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-08-30 00:29 +0200
                              Re: Inserting a DIV inside another DIV John G Harris <niam@jghnorth.org.uk.invalid> - 2017-08-30 16:33 +0100
                      Re: Inserting a DIV inside another DIV John G Harris <niam@jghnorth.org.uk.invalid> - 2017-08-29 09:57 +0100
                        Re: Inserting a DIV inside another DIV "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-08-29 18:05 +0200
                          Re: Inserting a DIV inside another DIV John G Harris <niam@jghnorth.org.uk.invalid> - 2017-08-30 16:33 +0100
                            Re: Inserting a DIV inside another DIV "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-08-30 21:43 +0200
                              Re: Inserting a DIV inside another DIV John G Harris <niam@jghnorth.org.uk.invalid> - 2017-08-31 10:08 +0100
                                Re: Inserting a DIV inside another DIV "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-08-31 16:40 +0200
                                  Re: Inserting a DIV inside another DIV John G Harris <niam@jghnorth.org.uk.invalid> - 2017-08-31 18:37 +0100

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


#33896

FromJohn G Harris <niam@jghnorth.org.uk.invalid>
Date2017-08-27 14:10 +0100
Message-ID<35h5qcdplf5mg0lfup3q02qs4k36o9q54g@4ax.com>
In reply to#33883
On Sat, 26 Aug 2017 21:21:12 +0100, Peter Flynn <peter@silmaril.ie>
wrote:

  <snip>
>One "appends" to a list; if there is
>nothing to append to, it makes no sense touse the word "append".
  <snip>

What about 
  "" + "Fred"
Is that not an append action?

Incidentally, the subject is 'appendChild', not 'append'.
Do you say it should be called 'insertChildAtEnd'?

  John

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


#33898

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2017-08-27 15:40 +0200
Message-ID<XnsA7DE9F8646C73eejj99@194.109.6.166>
In reply to#33896
John G Harris <niam@jghnorth.org.uk.invalid> wrote on 27 Aug 2017 in 
comp.lang.javascript:

> On Sat, 26 Aug 2017 21:21:12 +0100, Peter Flynn <peter@silmaril.ie>
> wrote:
> 
>   <snip>
>>One "appends" to a list; if there is
>>nothing to append to, it makes no sense touse the word "append".
>   <snip>
> 
> What about 
>   "" + "Fred"

stipulate:

let result = "" + "Fred";

> Is that not an append action?

No, it is not, it is called concatenation.

Appending you do to something existing,
while in this syntax a totally new resultstring results,
while the building parts remain unchanged.

[that's why concatenation is so time and memory inefficient in Javascript]

> Incidentally, the subject is 'appendChild', not 'append'.
> Do you say it should be called 'insertChildAtEnd'?

Many posters seem to forget that "appending" is about the DOM,
and the DOM is a "tree" [not a "list"].

The HTML-elements that are stored in the tree, 
can have inner-elements when experssed as a markup-script.

But in the DOM-tree they are just child elements,
and they are NOT "in" the parent element, 
but are appended to, read "linked to", that parent.

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

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


#33904

FromJohn G Harris <niam@jghnorth.org.uk.invalid>
Date2017-08-28 10:50 +0100
Message-ID<hnp7qc953aa7dk7ks2i0mf90j1641d5t4i@4ax.com>
In reply to#33898
On Sun, 27 Aug 2017 15:40:54 +0200, "Evertjan."
<exxjxw.hannivoort@inter.nl.net> wrote:

>John G Harris <niam@jghnorth.org.uk.invalid> wrote on 27 Aug 2017 in 
>comp.lang.javascript:
>
>> On Sat, 26 Aug 2017 21:21:12 +0100, Peter Flynn <peter@silmaril.ie>
>> wrote:
>> 
>>   <snip>
>>>One "appends" to a list; if there is
>>>nothing to append to, it makes no sense touse the word "append".
>>   <snip>
>> 
>> What about 
>>   "" + "Fred"
>
>stipulate:
>
>let result = "" + "Fred";
>
>> Is that not an append action?
>
>No, it is not, it is called concatenation.

As usual, there are several ways to describe what is happening.

First way : We already have "" and we append "Fred" to it.

Second way : We take "" and "Fred" and join them together (concatenate
them).

Third way : We use Currying. We apply a unary function to "" that
returns another unary function. We apply this other unary function to
"Fred" and it returns the result of appending "" to "Fred", or the
result of joining "" to "Fred", whichever you feel like saying.


>Appending you do to something existing,
>while in this syntax a totally new resultstring results,
>while the building parts remain unchanged.
>
>[that's why concatenation is so time and memory inefficient in Javascript]
>
>> Incidentally, the subject is 'appendChild', not 'append'.
>> Do you say it should be called 'insertChildAtEnd'?
>
>Many posters seem to forget that "appending" is about the DOM,
>and the DOM is a "tree" [not a "list"].
>
>The HTML-elements that are stored in the tree, 
>can have inner-elements when experssed as a markup-script.
>
>But in the DOM-tree they are just child elements,
>and they are NOT "in" the parent element, 
>but are appended to, read "linked to", that parent.

No, the child objects are in a list. It is the list that is linked to
the parent object. Appending is to the end of the list.

  John

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


#33911

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2017-08-28 22:35 +0200
Message-ID<XnsA7DFE5BB9502Eeejj99@194.109.6.166>
In reply to#33904
John G Harris <niam@jghnorth.org.uk.invalid> wrote on 28 Aug 2017 in 
comp.lang.javascript:

>>let result = "" + "Fred";
>>
>>> Is that not an append action?
>>
>>No, it is not, it is called concatenation.
> 
> As usual, there are several ways to describe what is happening.

Yes, there are right ways and wrong ways, as usual.

> First way : We already have "" and we append "Fred" to it.

No, that could be happening in other languages, BUT NOT IN JAVASCRIPT.

In Javascript both strings on each side of the + operator
are made into a new memory-location that just fits the combined length
and then a pointer is returned to assign a variable to it.
 
If the temporary location of the first string could be enlarged to 
accomodate the appending of the second one, that would be extremely 
wastefull in memory, as Javascript has no limited length for strings, but 
much faster.


-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

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


#33912

FromTim Streater <timstreater@greenbee.net>
Date2017-08-28 22:53 +0100
Message-ID<280820172253372614%timstreater@greenbee.net>
In reply to#33911
In article <XnsA7DFE5BB9502Eeejj99@194.109.6.166>, Evertjan.
<exxjxw.hannivoort@inter.nl.net> wrote:

>John G Harris <niam@jghnorth.org.uk.invalid> wrote on 28 Aug 2017 in 
>comp.lang.javascript:
>
>>>let result = "" + "Fred";
>>>
>>>> Is that not an append action?
>>>
>>>No, it is not, it is called concatenation.
>> 
>> As usual, there are several ways to describe what is happening.
>
>Yes, there are right ways and wrong ways, as usual.
>
>> First way : We already have "" and we append "Fred" to it.
>
>No, that could be happening in other languages, BUT NOT IN JAVASCRIPT.
>
>In Javascript ...
> 
>wastefull in memory, as Javascript ...

Careful Evertjan, or you'll be triggering the auto-response from the
PointyHead-bot.

-- 
"It is hard to imagine a more stupid decision or more dangerous way of 
making decisions than by putting those decisions in the hands of people 
who pay no price for being wrong."  --  Thomas Sowell

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


#33913

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2017-08-29 00:27 +0200
Message-ID<XnsA7E049A31B72eejj99@194.109.6.166>
In reply to#33912
Tim Streater <timstreater@greenbee.net> wrote on 28 Aug 2017 in 
comp.lang.javascript:

> In article <XnsA7DFE5BB9502Eeejj99@194.109.6.166>, Evertjan.
> <exxjxw.hannivoort@inter.nl.net> wrote:
> 
>>John G Harris <niam@jghnorth.org.uk.invalid> wrote on 28 Aug 2017 in 
>>comp.lang.javascript:
>>
>>>>let result = "" + "Fred";
>>>>
>>>>> Is that not an append action?
>>>>
>>>>No, it is not, it is called concatenation.
>>> 
>>> As usual, there are several ways to describe what is happening.
>>
>>Yes, there are right ways and wrong ways, as usual.
>>
>>> First way : We already have "" and we append "Fred" to it.
>>
>>No, that could be happening in other languages, BUT NOT IN JAVASCRIPT.
>>
>>In Javascript ...
>> 
>>wastefull in memory, as Javascript ...
> 
> Careful Evertjan, or you'll be triggering the auto-response from the
> PointyHead-bot.

Well, I would prefer to be confronted with counter-arguments,
and do not think automated ad-hominem bots to be either usefull or polite,
but building a wall is also a non-sequitur.

I started of in the early 1980's with assembler on the Signetics 2650, 
so am still sensitive to spilling memory, processor-cycles and solder-burns,
the last one shamefully absent in Javascript. ;-)

The Forth-kernel and meta-compiler I wrote there could really append 
strings, as strings there were fixed-length arrays with single-byte or 
single-word [16bit] elements.

Exor-ing one of the 4 processor-registers with itself was so much more 
efficient than filling it with H00, that it gave me joy for a week.

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

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


#33917

FromJohn G Harris <niam@jghnorth.org.uk.invalid>
Date2017-08-29 10:16 +0100
Message-ID<i5caqcphnufnapjhluceqe88ela94sn65m@4ax.com>
In reply to#33913
On Tue, 29 Aug 2017 00:27:08 +0200, "Evertjan."
<exxjxw.hannivoort@inter.nl.net> wrote:

  <snip>
>Exor-ing one of the 4 processor-registers with itself was so much more 
>efficient than filling it with H00, that it gave me joy for a week.

KDF9 was even nicer. To increment by 1 do
  not; neg;
To decrement by 1 do
  neg; not;

  John

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


#33923

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2017-08-29 23:05 +0200
Message-ID<XnsA7E0EADFCAD35eejj99@194.109.6.166>
In reply to#33917
John G Harris <niam@jghnorth.org.uk.invalid> wrote on 29 Aug 2017 in 
comp.lang.javascript:

> On Tue, 29 Aug 2017 00:27:08 +0200, "Evertjan." wrote:
> 
>   <snip>
>>Exor-ing one of the 4 processor-registers with itself was so much more 
>>efficient than filling it with H00, that it gave me joy for a week.
> 
> KDF9 was even nicer.

don't know that

> To increment by 1 do
>   not; neg;
> To decrement by 1 do
>   neg; not;

Seems very compicated and inefficient. ;-(

The nice thing about my example is, 
that the operator-code takes only one byte,
of which 6 bits declare the exor-action on the zero-register
and 2 bits point back to the same zero-register,
and in it takes [took, sorry] just 2 cycles or 6 clock periods.

Assembler code EORZ-0 or Hex 20.

<https://amigan.yatho.com/2650UM.html#eorz.html>

Of course, SUBZ-0 would do the same and in ther same time,
but it seems I was more inclined to the EORZ-0.





-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

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


#33924

FromTim Streater <timstreater@greenbee.net>
Date2017-08-29 22:51 +0100
Message-ID<290820172251357607%timstreater@greenbee.net>
In reply to#33923
In article <XnsA7E0EADFCAD35eejj99@194.109.6.166>, Evertjan.
<exxjxw.hannivoort@inter.nl.net> wrote:

>John G Harris <niam@jghnorth.org.uk.invalid> wrote on 29 Aug 2017 in 
>comp.lang.javascript:
>
>> On Tue, 29 Aug 2017 00:27:08 +0200, "Evertjan." wrote:
>> 
>>   <snip>
>>>Exor-ing one of the 4 processor-registers with itself was so much more 
>>>efficient than filling it with H00, that it gave me joy for a week.
>> 
>> KDF9 was even nicer.
>
>don't know that

You could always look it up:

  <https://en.wikipedia.org/wiki/English_Electric_KDF9>

The first computer I used was an Elliott 803B (q. v.) in 1965.

-- 
"People don't buy Microsoft for quality, they buy it for compatibility
with what Bob in accounting bought last year. Trace it back - they buy
Microsoft because the IBM Selectric didn't suck much" - P Seebach, afc

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


#33925

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2017-08-30 00:29 +0200
Message-ID<XnsA7E150C65853eejj99@194.109.6.166>
In reply to#33924
Tim Streater <timstreater@greenbee.net> wrote on 29 Aug 2017 in 
comp.lang.javascript:

> In article <XnsA7E0EADFCAD35eejj99@194.109.6.166>, Evertjan.
> <exxjxw.hannivoort@inter.nl.net> wrote:
> 
>>John G Harris <niam@jghnorth.org.uk.invalid> wrote on 29 Aug 2017 in 
>>comp.lang.javascript:
>>
>>> On Tue, 29 Aug 2017 00:27:08 +0200, "Evertjan." wrote:
>>> 
>>>   <snip>
>>>>Exor-ing one of the 4 processor-registers with itself was so much more 
>>>>efficient than filling it with H00, that it gave me joy for a week.
>>> 
>>> KDF9 was even nicer.
>>
>>don't know that
> 
> You could always look it up:
> 
>   <https://en.wikipedia.org/wiki/English_Electric_KDF9>

No mention there, that it was even nicer.

My [read only] memory of those times is so subjective 
about relative niceness, but perhaps that resides in the genes.

<http://www.psypost.org/2012/04/the-neurogenics-of-nicenes-peoples-relative-
niceness-may-reside-in-their-genes-10992>

> The first computer I used was an Elliott 803B (q. v.) in 1965.

"My" first one [I was not allowed to use it yet as a first year student, it 
was 1963] was the Z.E.B.R.A. of the Groningen university, with a room full 
of 19-inch racks with flip-flopping vacuum-tube-pairs, and 32 kB or 
magnetic-ring memory.

She was switched off once a year, and only on the restart many of her tubes 
expired. She was bought in 1959 for 150.000 guilders. 

In 1951 I had already seen some automatic machines in the Philips Nat-LAB in 
Eindhoven, and of course the Hollerith sorting-machines of that time.





-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

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


#33926

FromJohn G Harris <niam@jghnorth.org.uk.invalid>
Date2017-08-30 16:33 +0100
Message-ID<1nldqcdh5rrfbtp5ua1rmr0on5b11uro67@4ax.com>
In reply to#33923
On Tue, 29 Aug 2017 23:05:20 +0200, "Evertjan."
<exxjxw.hannivoort@inter.nl.net> wrote:

>John G Harris <niam@jghnorth.org.uk.invalid> wrote on 29 Aug 2017 in 
>comp.lang.javascript:
>
>> On Tue, 29 Aug 2017 00:27:08 +0200, "Evertjan." wrote:
>> 
>>   <snip>
>>>Exor-ing one of the 4 processor-registers with itself was so much more 
>>>efficient than filling it with H00, that it gave me joy for a week.
>> 
>> KDF9 was even nicer.
>
>don't know that
>
>> To increment by 1 do
>>   not; neg;
>> To decrement by 1 do
>>   neg; not;
>
>Seems very compicated and inefficient. ;-(
  <snip>

Hardly. The two 8-bit instructions took 1 microsecond each (1 cycle
each). It was a zero-address machine, acting on a nesting stack. First
delivery around 1963. 6 cabinets about 1.8m high and 1.2m wide.

  John

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


#33915

FromJohn G Harris <niam@jghnorth.org.uk.invalid>
Date2017-08-29 09:57 +0100
Message-ID<3taaqcd9kgafjeop5t3o0aqrdclcbo69rh@4ax.com>
In reply to#33911
On Mon, 28 Aug 2017 22:35:01 +0200, "Evertjan."
<exxjxw.hannivoort@inter.nl.net> wrote:

>John G Harris <niam@jghnorth.org.uk.invalid> wrote on 28 Aug 2017 in 
>comp.lang.javascript:
>
>>>let result = "" + "Fred";
>>>
>>>> Is that not an append action?
>>>
>>>No, it is not, it is called concatenation.
>> 
>> As usual, there are several ways to describe what is happening.
>
>Yes, there are right ways and wrong ways, as usual.

In other words, one preferred way is a law of nature and all other
preferences are utterly forbidden. Sounds familiar.


>> First way : We already have "" and we append "Fred" to it.
>
>No, that could be happening in other languages, BUT NOT IN JAVASCRIPT.
>
>In Javascript both strings on each side of the + operator
>are made into a new memory-location that just fits the combined length
>and then a pointer is returned to assign a variable to it.
> 
>If the temporary location of the first string could be enlarged to 
>accomodate the appending of the second one, that would be extremely 
>wastefull in memory, as Javascript has no limited length for strings, but 
>much faster.

  var a = new Thing("");
  a.append("Fred");

How the append is coded is not relevant to the user of the function,
and it might not be possible to find out how it's done. The user wants
to append so that is what the user is allowed to call it.

  John

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


#33922

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2017-08-29 18:05 +0200
Message-ID<XnsA7E0B7F46F1BEeejj99@194.109.6.166>
In reply to#33915
John G Harris <niam@jghnorth.org.uk.invalid> wrote on 29 Aug 2017 in 
comp.lang.javascript:

>>> As usual, there are several ways to describe what is happening.
>>
>>Yes, there are right ways and wrong ways, as usual.
> 
> In other words, one preferred way is a law of nature and all other
> preferences are utterly forbidden. Sounds familiar.

What utter nonsense.

It just means that the "several ways to describe what is happening" 
are not all just as valid.

It does not mean that I claim the right way to be what I think.

It just means that we should discuss and learn from eachother.

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

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


#33927

FromJohn G Harris <niam@jghnorth.org.uk.invalid>
Date2017-08-30 16:33 +0100
Message-ID<4imdqc97bprvtmvre7r4k0cs3lb1nsglh0@4ax.com>
In reply to#33922
On Tue, 29 Aug 2017 18:05:00 +0200, "Evertjan."
<exxjxw.hannivoort@inter.nl.net> wrote:

>John G Harris <niam@jghnorth.org.uk.invalid> wrote on 29 Aug 2017 in 
>comp.lang.javascript:
>
>>>> As usual, there are several ways to describe what is happening.
>>>
>>>Yes, there are right ways and wrong ways, as usual.
>> 
>> In other words, one preferred way is a law of nature and all other
>> preferences are utterly forbidden. Sounds familiar.
>
>What utter nonsense.

True.


>It just means that the "several ways to describe what is happening" 
>are not all just as valid.

Sometimes, but not always.


>It does not mean that I claim the right way to be what I think.

I'm very glad to hear it. I wish everyone was the same.


>It just means that we should discuss and learn from eachother.

As I wrote, I think your reasoning doesn't apply in this case. For
another example, do you say 'push' and 'pop' are inappropriate names
because they are implemented as array actions?

  John

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


#33929

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2017-08-30 21:43 +0200
Message-ID<XnsA7E1DD06B7E5Eeejj99@194.109.6.166>
In reply to#33927
John G Harris <niam@jghnorth.org.uk.invalid> wrote on 30 Aug 2017 in 
comp.lang.javascript:

> For
> another example, do you say 'push' and 'pop' are inappropriate names
> because they are implemented as array actions?

Did I?

No.

btw, 'push' and 'pop' are STACK actions.

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

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


#33930

FromJohn G Harris <niam@jghnorth.org.uk.invalid>
Date2017-08-31 10:08 +0100
Message-ID<nekfqc11dtv6uvf2ofo222rva9nvvblkha@4ax.com>
In reply to#33929
On Wed, 30 Aug 2017 21:43:39 +0200, "Evertjan."
<exxjxw.hannivoort@inter.nl.net> wrote:

>John G Harris <niam@jghnorth.org.uk.invalid> wrote on 30 Aug 2017 in 
>comp.lang.javascript:
>
>> For
>> another example, do you say 'push' and 'pop' are inappropriate names
>> because they are implemented as array actions?
>
>Did I?
>
>No.
>
>btw, 'push' and 'pop' are STACK actions.

My point exactly. That's why I said that 'append' can be the right
name in some cases regardless of implementation, and is right for the
cases I have given.

(You have remembered ECMAScript's Array.prototype.pop and
Array.prototype.push methods, haven't you?)

  John

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


#33931

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2017-08-31 16:40 +0200
Message-ID<XnsA7E2A9B4F9C53eejj99@194.109.6.166>
In reply to#33930
John G Harris <niam@jghnorth.org.uk.invalid> wrote on 31 Aug 2017 in 
comp.lang.javascript:

>>btw, 'push' and 'pop' are STACK actions.
> 
> My point exactly. That's why I said that 'append' can be the right
> name in some cases regardless of implementation, and is right for the
> cases I have given.

Well no, you cannot append to a stack, as the naming is vertical.


-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

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


#33933

FromJohn G Harris <niam@jghnorth.org.uk.invalid>
Date2017-08-31 18:37 +0100
Message-ID<o8igqct14h5tns5ja5s5def1g8e0jt3juh@4ax.com>
In reply to#33931
On Thu, 31 Aug 2017 16:40:58 +0200, "Evertjan."
<exxjxw.hannivoort@inter.nl.net> wrote:

  <snip>
>Well no, you cannot append to a stack, as the naming is vertical.

It's upend, right? :-)

  John

[toc] | [prev] | [standalone]


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

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


csiph-web