«« Next » « Previous
«« Next » « Previous

Link Details

Announcement

iPhone DZone: Fresh Links On Your iPhone by matt at Sat Jul 05 14:09:51 EDT 2008

Reading DZone on your iPhone just got a little bit easier. Visit http://dzone.com/iphone from your iPhone to try out our beta iPhone support. You can view stories, filter by tags, and login. We'd appreciate your feedback at feedback@dzone.com.

We can't do it for you. Login and vote now.
Link 80746 thumbnail

By bloid
via pragdave.blogs.pragprog.com
Published: May 15 2008 / 07:47

Some recent changes in Ruby 1.9 point to the transition away from symbols being immediate objects. In particular, they lose their integer representation, and hence the methods Fixnum.id2name, Fixnum.to_sym, and Symbol.to_i have been removed. I'm expecting to see symbols migrate to the heap as 1.9 continues to evolve.
  • 6
  • 0
  • 1143
  • 426

Comments

Add your comment
User 264051 avatar

bspies replied ago:

0 votes Vote down Vote up Reply

Symbols are one of the oddities of Ruby that puzzled me when I first started to learn the language. Why would you want to expose the internals of your language implementation like this? I would be nice to see symbols go away altogether, but probably difficult given how widely they are used in Ruby now.

User 283139 avatar

ceaseoleo replied ago:

0 votes Vote down Vote up Reply

I may be wrong.. but this change is good that in a sense.. the symbols will be able to be cleaned up and won't stick around. But we loose some of the performance of the quick lookup.
@bspies Yes.. for example if you know you have a rails app, then you could for example get hit easier with a DOS attack, but in all honesty .. if someone wants to attack your site.. its gonna happen no matter what

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (6)



Voters Against This Link (0)