[#51834] [ruby-trunk - Bug #7780][Open] Marshal & YAML should deserialize only basic types by default. — "marcandre (Marc-Andre Lafortune)" <ruby-core@...>
[#51864] [ruby-trunk - Bug #7784][Open] [mingw] r39055 creates test failures and functionality loss — "jonforums (Jon Forums)" <redmine@...>
[#51870] [Backport93 - Backport #7786][Assigned] fix for abstract namespace — "shugo (Shugo Maeda)" <redmine@...>
[#51897] [ruby-trunk - Feature #7791][Open] Let symbols be garbage collected — "rosenfeld (Rodrigo Rosenfeld Rosas)" <rr.rosas@...>
On Wed, Feb 6, 2013 at 2:37 PM, rosenfeld (Rodrigo Rosenfeld Rosas)
(2013/02/06 22:50), shyouhei (Shyouhei Urabe) wrote:
A slightly different idea, closer to the existing garbage collection:
I think Koichi's approach is a better one. I don't think there are any
(2013/02/07 20:25), Rodrigo Rosenfeld Rosas wrote:
[#51898] [ruby-trunk - Feature #7792][Open] Make symbols and strings the same thing — "rosenfeld (Rodrigo Rosenfeld Rosas)" <rr.rosas@...>
On 8 February 2013 03:01, jeremyevans0 (Jeremy Evans) <
Em 07-02-2013 19:15, Matthew Kerwin escreveu:
Hi,
Em 07-02-2013 21:58, Yukihiro Matsumoto escreveu:
You don't need to hijack any code for it, you'd just use it as
Em 06-02-2013 12:36, Yorick Peterse escreveu:
I don't think I'm following you, can you explain what's supposedly
Em 06-02-2013 13:25, Yorick Peterse escreveu:
> What I'm trying to say is that the main reason why symbols exist in
Em 06-02-2013 16:22, Yorick Peterse escreveu:
> And "growing until you hit your memory limit" is actually only valid
On 7 February 2013 20:46, rosenfeld (Rodrigo Rosenfeld Rosas) wrote:
Em 07-02-2013 10:04, Matthew Kerwin escreveu:
On 7 February 2013 23:09, Rodrigo Rosenfeld Rosas wrote:
On Feb 7, 2013, at 10:43, David MacMahon <[email protected]> =
SXNzdWUgIzc3OTIgaGFzIGJlZW4gdXBkYXRlZCBieSBkc2ZlcnJlaXJhIChEYW5pZWwgRmVycmVp
ZGFuaWVsZGFzaWx2YWZlcnJlaXJhQGdtYWlsLmNvbSB3cm90ZToKPiBJZiB3ZSBhcmUgY29uc2lk
[#51965] [ruby-trunk - Feature #7795][Open] Symbol.defined? and/or to_existing_symbol — "Student (Nathan Zook)" <blogger@...>
[#51977] [ruby-trunk - Feature #7797][Open] Hash should be renamed to StrictHash and a new Hash should be created to behave like AS HashWithIndifferentAccess — "rosenfeld (Rodrigo Rosenfeld Rosas)" <rr.rosas@...>
[#52042] [ruby-trunk - Bug #7805][Open] ruby 2.0rc2 core on solaris — "groenveld@... (John Groenveld)" <groenveld@...>
[#52048] [ruby-trunk - Bug #7806][Open] inconsistency between Method#inspect and Method#name — "Hanmac (Hans Mackowiak)" <hanmac@...>
[#52073] [ruby-trunk - Bug #7815][Open] Backport: Warning about TracePoint events to 2.0.0 — "zzak (Zachary Scott)" <zachary@...>
[#52075] [ruby-trunk - Feature #7816][Open] Don't invalidate method caches when defining a new method on a class without subclasses — "charliesome (Charlie Somerville)" <charlie@...>
[#52077] [ruby-trunk - Bug #7817][Open] (Unable to compile Ruby 2.0.0-rc2 on OSX (clang version 2.1) — "injekt (Lee Jarvis)" <ljjarvis@...>
[#52087] [ruby-trunk - Bug #7820][Assigned] Let's decide Ruby 2.0 supported platform list — "mame (Yusuke Endoh)" <mame@...>
Dne 10.2.2013 13:01, mame (Yusuke Endoh) napsal(a):
[#52130] [ruby-trunk - Bug #7829][Open] Rounding error in Ruby Time — "loirotte (Philippe Dosch)" <loirotte@...>
2013/2/22 David MacMahon <[email protected]>:
2013/4/4 David MacMahon <[email protected]>:
2013/4/5 David MacMahon <[email protected]>:
[#52131] [ruby-trunk - Bug #7830][Open] Ruby packages should not build with -Werror when distributed — "kremenek (Ted Kremenek)" <kremenek@...>
[#52165] [ruby-trunk - Feature #7839][Open] Symbol.freeze_symbols — "tenderlovemaking (Aaron Patterson)" <aaron@...>
[#52206] [ruby-trunk - Bug #7842][Assigned] An alias of a "prepend"ed method skips the original method when calling super — "mame (Yusuke Endoh)" <mame@...>
[#52215] [ruby-trunk - Bug #7845][Open] Strip doesn't handle unicode space characters in ruby 1.9.2 & 1.9.3 (does in 1.9.1) — "timothyg56 (Timothy Garnett)" <timothyg@...>
[#52254] p385 breaks bakward compatibility — V咜 Ondruch <v.ondruch@...>
Hi,
[#52267] [ruby-trunk - Feature #7854][Open] New method Symbol[string] — "Student (Nathan Zook)" <blogger@...>
[#52371] Broken email notification from Redmine? — =?ISO-8859-2?Q?V=EDt_Ondruch?= <v.ondruch@...>
Hi,
[#52492] Redmine & utf in title bug — Marc-Andre Lafortune <ruby-core-mailing-list@...>
I notice a lot of
[#52495] [ruby-trunk - Bug #7879][Open] File.readable? fails when ruby runs as root — "balbi (Feliple Balbi)" <balbif@...>
[#52508] Should I document refinements in a PickAxe update? — Dave Thomas <dave@...>
Gentle core folk:
On Feb 18, 2013, at 19:58, Dave Thomas <[email protected]> wrote:
> I think a document in a PickAxe update with appropriate warnings would
2013/2/19 Dave Thomas <[email protected]>:
[#52581] Fwd: Fixnum: freeze status on ruby 2.0.0 rc2 — Ryan Davis <ryand-ruby@...>
[#52596] [CommonRuby - Feature #7895][Open] Exception#backtrace_locations to go with Thread#backtrace_locations and Kernel#caller_locations — "headius (Charles Nutter)" <headius@...>
(2013/02/21 6:02), headius (Charles Nutter) wrote:
On Thu, Feb 21, 2013 at 8:36 AM, SASADA Koichi <[email protected]> wrote:
[#52701] [ruby-trunk - Feature #7914][Open] Case for local class methods — "trans (Thomas Sawyer)" <transfire@...>
[#52704] Feature Request w/ Patch: CSV::Row, adds ".each_pair" as an alias for ".each" — Ryan Dowell <ssstarduster@...>
A very simple patch. Adds ".each_pair" as an alias to ".each" in
[#52722] [ruby-trunk - Bug #7917][Open] Can't write to a Logger in a signal handler — "mperham (Mike Perham)" <mperham@...>
"mperham (Mike Perham)" <[email protected]> wrote:
[#52723] Improving order of NEWS — Marc-Andre Lafortune <ruby-core-mailing-list@...>
I feel the NEWS are in the wrong order: C API, builtin classes, std-lib,
[#52727] [ruby-trunk - Feature #7918][Open] Create Signal.in_trap?() — "kosaki (Motohiro KOSAKI)" <kosaki.motohiro@...>
(2013/02/23 11:31), kosaki (Motohiro KOSAKI) wrote:
[#52737] What's the *right* way to build Ruby from source on a Linux system that doesn't yet have Ruby? — Paul Sherwood <paul.sherwood@...>
We'd like to add Ruby support in a clean Linux environment which has
On Sat, Feb 23, 2013 at 9:38 AM, Paul Sherwood
On 23/02/2013 13:16, Luis Lavena wrote:
> On 23/02/2013 13:16, Luis Lavena wrote:
[#52876] [ruby-trunk - Bug #7957][Open] rb_str_modify() does not prevent shared string from rb_str_set_len() — "normalperson (Eric Wong)" <normalperson@...>
[#52877] Any documentation about debugging in Ruby 2.0.0 — Rodrigo Rosenfeld Rosas <rr.rosas@...>
Hi, I couldn't find how to debug Ruby 2.0.0 programs, but only a few
On Monday, February 25, 2013, Rodrigo Rosenfeld Rosas wrote:
Em 25-02-2013 10:47, Jeremy Kemper escreveu:
(2013/02/26 0:22), Rodrigo Rosenfeld Rosas wrote:
(2013/02/26 2:34), SASADA Koichi wrote:
Em 26-02-2013 15:14, SASADA Koichi escreveu:
(2013/02/27 4:19), Rodrigo Rosenfeld Rosas wrote:
Em 26-02-2013 17:23, SASADA Koichi escreveu:
I rewrite a debugger for Ruby 2.0.
Thank you very much, Koichi, but I couldn't get it to work yet:
[#52997] [ruby-trunk - Feature #7978][Open] boolean to_i — "alexeymuranov (Alexey Muranov)" <redmine@...>
[#53017] [ruby-trunk - Bug #7982][Open] rb_raise segfaults on %lli format with (0xffffffff + 1) — "erik.s.chang (Erik Chang)" <erik.s.chang@...>
[#53035] [ruby-trunk - Feature #7986][Open] Custom case statement comparison method — "trans (Thomas Sawyer)" <transfire@...>
[ruby-core:51988] [ruby-trunk - Feature #7797] Hash should be renamed to StrictHash and a new Hash should be created to behave like AS HashWithIndifferentAccess
Issue #7797 has been updated by rosenfeld (Rodrigo Rosenfeld Rosas).
shevegen (markus heiler) wrote:
> > Since #7792 has been rejected (although I don't really understand the
> > reason except people being afraid of changing I guess)
>
> Several reasons were given to you. I do not understand why you try to
> "summarize" them all by stating that "people are afraid of change".
The only real reason I remember people mentioning is the performance thing and how they are different internally. It shouldn't really matter to the language design its implementation details (if they are different internally or not, for instance). And for the performance argument I really believe symbols cause more harm than good to the overall performance given all conversions that it will require in most code bases (even if you don't do that directly it is likely that you rely on some gem that will do that).
> If ruby would get rid of symbols, the language would be simnpler for
> newcomers. But why have symbols been exposed at the ruby-language
> level at all?
Have no idea! My suspect is that someone thought: "hey maybe it would be a great idea if we could optimize some constant strings - we could create a symbol for that - hey, look at my micro-benchmarks, it really is a great idea!".
> That's right, because they are simply more efficient than Strings.
On micro-benchmarks I agree they may do some small difference. On real world-case apps though I'd suspect its presence is actually causing code to perform worse.
> What you basically tried in your earlier proposal was to change
> ruby to a completely different language...
Why do you think that removing symbols would change Ruby in a fundamental way? I believe 99.9% of all Ruby code would still work without any changes if :symbol was the same as 'symbol'.freeze.
> This is a huge conceptual change
This is your opinion. I don't agree.
> ..I myself would rather like if this new syntax would
> not have been added at all. I dont like it, and even
> though you save a few keys
The problem is not saving keys for my particular case. It is pretty natural to me when I'm typing to find the comma (:). Greater than signals (>) and, specially the equals (=) symbol require much more effort, which makes a big difference when you're creating a hash with many keys. Those two symbols are also very far from each other.
> I do agree with you that it is annoying that symbols
> and strings can be used for hash keys. When I write
> ruby code, I always have to ask myself whether I
> want to use a symbol or a string as key.
That is exactly the reason why I created this ticket.
> I do not however see how your proposal makes THIS
> very decision any simpler.
Simple, you don't have to worry about it anymore. Just don't think. If you've typed a symbol, that's fine. A string instead? No problem. Both should work interchangeable:
h = {a: 1, 'b' => 1}
h['a'] == h[:b] # == 1
----------------------------------------
Feature #7797: Hash should be renamed to StrictHash and a new Hash should be created to behave like AS HashWithIndifferentAccess
https://bugs.ruby-lang.org/issues/7797#change-35996
Author: rosenfeld (Rodrigo Rosenfeld Rosas)
Status: Open
Priority: Normal
Assignee: matz (Yukihiro Matsumoto)
Category: core
Target version: Next Major
Since #7792 has been rejected (although I don't really understand the reason except people being afraid of changing I guess) I'd like to propose an alternative solution to most of the problems caused by the differences between symbols and strings.
From my previous experience, most of the time I'm accessing a hash, I'd prefer that it behaved like HashWithIndifferentAccess (HWIA from now) from active_support gem.
Transforming all possible hashes in some object to HWIA is not only boring to do code but also time consuming.
Instead, I propose that {}.class == Hash, with Hash being implemented as HWIA and the current Hash implementation renamed to StrictHash.
That way, this should work:
a = {a: 1, 'b' => 2}
a[:a] == a['a'] && a['b'] == a[:b]
I don't really see any real use case where people really want to have a hash like this:
h = {a: 1, 'a' => 2}
This would only confuse people.
It also avoids confusion when parsing/unparsing from popular serialization formats, like JSON:
currently:
h = {a: 1}
j = JSON.unparse h
h2 = JSON.parse j
h[:a] != h2[:a]
With the new proposition (I'm assuming JSON should use Hash instead of StrictHash when parsing) h[:a] == h2[:a].
This is just a small example but most real-world usage for hashes would benefit from regular hashes behaving like HWIA.
--
http://bugs.ruby-lang.org/