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


Groups > comp.lang.javascript > #24921

Re: Can you change value of a substring?

Newsgroups comp.lang.javascript
Subject Re: Can you change value of a substring?
From "Evertjan." <exxjxw.hannivoort@inter.nl.net>
References <a6d074ff-773b-42d0-96dc-31bd5d733e3d@googlegroups.com> <XnsA350E19EA17B4eejj99@194.109.133.133> <string-20140618222250@ram.dialup.fu-berlin.de>
Date 2014-06-18 23:42 +0200
Message-ID <XnsA350F12DEEDEBeejj99@194.109.133.133> (permalink)

Show all headers | View raw


ram@zedat.fu-berlin.de (Stefan Ram) wrote on 18 jun 2014 in 
comp.lang.javascript:

> "Evertjan." <exxjxw.hannivoort@inter.nl.net> writes:
>>There is no "value in a string".
> 
>   A string is a finite sequence of values, which are characters.

No.

A Javascript string is an enormous large number of bits, interpreted by most 
methods as 16 bit values, which can be interpreted as characters, but that 
does not have to be so. Only the standard read and write methods implement 
them as Unicode.

> It just so happens that a string

A Javascript string, not any string.

> also is immutable, so you 
> cannot change those values »in place«.

I would say: in its memory location.

>   (This shows that JavaScript has something to do with Java,
>   because about strings in Java one can say the same.)

An analog clock and a human usually have hands, 
does that fact mean they have "something to do" with eachother? 

Perhaps you can say the same near truth in both languages.

The same would apply to Javascript and VBS.
And perhaps many other languages.

But that is realy the implementation, you could easily device a Javascript 
engine that manipulates smaller strings "in place" by either ensuring the 
result is not larger than the original or reserving a fixed amount of memory 
for such strings. This would increase string manipulation of smaller strings 
cpu efficiency tremendously while using the present way for larger ones. 

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

Back to comp.lang.javascript | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Can you change value of a substring? jonas.thornvall@gmail.com - 2014-06-18 12:39 -0700
  Re: Can you change value of a substring? jonas.thornvall@gmail.com - 2014-06-18 13:09 -0700
    Re: Can you change value of a substring? Christoph Michael Becker <cmbecker69@arcor.de> - 2014-06-18 23:18 +0200
      Re: Can you change value of a substring? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-06-19 00:35 +0200
        Re: Can you change value of a substring? jonas.thornvall@gmail.com - 2014-06-18 15:52 -0700
    Re: Can you change value of a substring? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2014-06-18 16:14 -0700
  Re: Can you change value of a substring? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-06-18 22:10 +0200
    Re: Can you change value of a substring? jonas.thornvall@gmail.com - 2014-06-18 13:17 -0700
      Re: Can you change value of a substring? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-06-18 22:52 +0200
        Re: Can you change value of a substring? jonas.thornvall@gmail.com - 2014-06-18 14:03 -0700
          Re: Can you change value of a substring? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-06-19 00:07 +0200
            Re: Can you change value of a substring? jonas.thornvall@gmail.com - 2014-06-18 15:28 -0700
    Re: Can you change value of a substring? jonas.thornvall@gmail.com - 2014-06-18 13:20 -0700
      Re: Can you change value of a substring? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-06-18 23:22 +0200
        Re: Can you change value of a substring? jonas.thornvall@gmail.com - 2014-06-18 14:40 -0700
          Re: Can you change value of a substring? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-06-19 00:31 +0200
    Re: Can you change value of a substring? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-06-18 23:42 +0200
      Re: Can you change value of a substring? Christoph Michael Becker <cmbecker69@arcor.de> - 2014-06-19 00:13 +0200
        Re: Can you change value of a substring? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-06-19 00:45 +0200
          Re: Can you change value of a substring? Christoph Michael Becker <cmbecker69@arcor.de> - 2014-06-19 01:32 +0200
            Re: Can you change value of a substring? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-06-19 09:43 +0200
        Re: Can you change value of a substring? Christoph Michael Becker <cmbecker69@arcor.de> - 2014-06-19 01:48 +0200
          Re: Can you change value of a substring? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-06-19 09:56 +0200
  Re: Can you change value of a substring? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2014-06-18 16:12 -0700

csiph-web