Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Ruby
unintuitive language feature (exclamation functions)
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Nick Brown, post: 4616355"] I'm starting to wonder if this is actually a bug in Ruby? The documentation of sub! says it should modify the string in place. The code I posted does something different. After the a.sub!, executing "puts #{a}" outputs the modified version of a, but inserting that *exact same* string object into a database puts an UNMODIFIED version of the string into the DB. It's as if db.execute looks back in time to before the sub! when it gets the value of a. Something unexplained is going on here (unless the database module includes a time machine). [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Ruby
unintuitive language feature (exclamation functions)
Top