#ruby-lang - Wed 9 May 2007 between 00:00 and 00:05

NY Lost Funds



flowandcrashhmm
halorgiumtpope: lol, did you get the Shakespeare reference? or just ignore it?
tpope(ignored it)
flowandcrashhalo, i actually got it
it was good =)
halorgiumtpope: rgr that :P
tpopesymbols make good enums
flowandcrasharia, im getting caught up right now on the fact that you say :foo has an int value. makes me feel like it DOES have a reference
since symbols are unique
tpopeflowandcrash: open irb
flowandcrashit's open
tpopetype "foo".object_id
then type it 3 more times
then type :foo.object_id
flowandcrashdone
tpopethen type it 3 more times
finally, try with 42
flowandcrashnice
42 and symbol have same object id, "foo" string doesn't each time
tpoperight
that's why symbols are like numbers
Ariaflowandcrash: Yeah. It has an internal reference. But you're not supposed to care. It's just a name. Always the same object, no matter what.
tpopefor most objects, the object id is the object's address in memory
halorgium["foo".object_id == "foo".object_id, :foo.object_id == :foo.object_id]
AriaFor symbols, it's a bitmasked version of the internal table entry. For numbers, it's a shifted version of the number
tpopebut not for integers, or symbols
(or true, false, nil)
flowandcrashbecause they have a limited set right?
like there's only so many numbers you could wanna express
tpopeuh
flowandcrashand so many symbols. since they are all unique
tpopeAria was right, this was a bad route to go down
1000000000000000000000000000000000000000000000000000000
actually only small integers have that property
but it's an implementation detail
flowandcrashfair enough
halorgiumflowandcrash: Integer -> [-Infinity, -BigNum, -Fixnum, Fixnum, BigNum, Infinity]
flowandcrashhmm
nice
tpopewhy is Infinity not defined? :(

Page: 2 9 16 23 30 37 44 

IrcArchive

NY Lost Funds