ricardovsilva (Ricardo Silva)
- Login: ricardovsilva
- Registered on: 12/27/2017
- Last sign in: 12/27/2017
Issues
| open | closed | Total | |
|---|---|---|---|
| Assigned issues | 0 | 0 | 0 |
| Reported issues | 0 | 1 | 1 |
Activity
12/28/2017
-
12:47 AM Ruby Bug #14251: String insert changing value of other string
- Because if you do
~~~ ruby
foo = 'aaa'
bar = foo
bar = bar + 'ccc' #here references of foo doesn't changes
puts foo #aaa
pubs bar #aaaccc
~~~
As I can see, ruby only for string as reference when I call string methods, like:...
12/27/2017
-
10:29 PM Ruby Bug #14251 (Rejected): String insert changing value of other string
- ~~~ ruby
foo = 'abc'
bar = foo
bar.insert(1, d)
puts foo 'adbc'
puts bar 'adbc'
~~~
The example above should only affect bar variable. It leads to an error by programmer.
A bypass that I found is to do:
~~~ ruby
foo = '...