Hi --
I'm not getting why the argument's being a symbol is grounds for this:
1.kilo:bits.between?(1,1000)
being automatically parsed like this:
(1.kilo:bits).between?(1,1000)
or this:
1.kilo(:bits).between?(1,1000)
I can see, of course, that it saves on parentheses. But it would introduce a major exception to the way method calls are parsed, based on the class of the argument (assuming you're not suggesting that this extend generally to all method calls). I'm not seeing a need that would justify that.
David Black
David--
Yet, presently it is the later parsing. I realize that the minor alternate solution is dependent on the type of the first prarmeter --and thus would apply to all methods. But us that really that major a change. There is already a difference with regards to the binding (is that the word?) of blocks when using { vs. do. Would it not be simple enough to set a flag if the 1st argument butted up againt the method name?
trans.
Sorry, "But us that really that major a change." should read "But is that really such a major change?"
I see no need for this, where we can type
1.kilo_bytes
or even
1.kilo.bytes
works pretty well.
-matz.
Matz,
That's exactly the problem!
def kilo ; self * 1024 ; end
or shoud it be SI
def kilo ; self * 1000 ; end
And kilo_bytes means A LOT more methods:
mega_bytes, mega_byte, giga_bytes, giga_bits, milli_seconds, micro_seconds, ... ad infinitum.
trans.
mega:bytes etc. require internal branching anyway. If infinitum happens with mega_bytes, it would happen with
mega:bytes as well.
you can even generate combination methods like mega_bytes using metaprogramming feature.
besides that, I'd rather preserve colons inside the identifiers for some other purpose, such as namespace thingy, though I have no concrete idea yet.
-matz.
trans:
kilo should always be 1000. If you want to refer to 1024, you need to use the SI prefix kibi. A kilobyte is 1000 bytes; a kibibyte is 1024 bytes. (1 Kb = 1000 b; 1 Kib = 1024 b). Aside from that, I quite agree with matz.
-austin
austin,
While you and I know of kibi, the world at large isn't so formal or even aware.
We learned in school here that kilo = 1000.
I believe we should stick to kilo meaning 1000, else more confusion is spread. The 1024 of it in computer area is a bad idea to ever associate kilo with it, it leads to unneeded confusion. If people would use kibibyte more, others probably would adapt it too.
I'm not getting why the argument's being a symbol is grounds for this:
being automatically parsed like this:
or this:
I can see, of course, that it saves on parentheses. But it would introduce a major exception to the way method calls are parsed, based on the class of the argument (assuming you're not suggesting that this extend generally to all method calls). I'm not seeing a need that would justify that.
David Black
David--
Yet, presently it is the later parsing. I realize that the minor alternate solution is dependent on the type of the first prarmeter --and thus would apply to all methods. But us that really that major a change. There is already a difference with regards to the binding (is that the word?) of blocks when using { vs. do. Would it not be simple enough to set a flag if the 1st argument butted up againt the method name?
trans.
Sorry, "But us that really that major a change." should read "But is that really such a major change?"
I see no need for this, where we can type
or even
works pretty well.
-matz.
Matz,
That's exactly the problem!
or shoud it be SI
And kilo_bytes means A LOT more methods:
trans.
mega:bytes etc. require internal branching anyway. If infinitum happens with mega_bytes, it would happen with mega:bytes as well.
you can even generate combination methods like mega_bytes using metaprogramming feature.
besides that, I'd rather preserve colons inside the identifiers for some other purpose, such as namespace thingy, though I have no concrete idea yet.
-matz.
trans:
-austin
austin,
We learned in school here that kilo = 1000.
I believe we should stick to kilo meaning 1000, else more confusion is spread. The 1024 of it in computer area is a bad idea to ever associate kilo with it, it leads to unneeded confusion. If people would use kibibyte more, others probably would adapt it too.