[Pharo-project] hex

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Wed Feb 24 18:41:43 EST 2010


2010/2/24 Stéphane Ducasse <stephane.ducasse at inria.fr>:
>
> On Feb 24, 2010, at 6:47 PM, csrabak at bol.com.br wrote:
>
>> Stef,
>>
>> Squeak prints in lowercase and reads *correctly* only in uppercase. . .
>
> can you post the expression you use?
> Are you talking about byteArray? or plain number?

ByteArray, UUID and plain Number

Andreas Raab uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-ar.310.mcz

==================== Summary ====================

Name: Collections-ar.310
Author: ar
Time: 23 February 2010, 7:16:34.191 am
UUID: eb685ed0-dba7-d546-b63e-08f76154d027
Ancestors: Collections-ul.309

Conversions from/to hex representations in ByteArray, for example:

       #[122 43 213 7] hex
               => '7a2bd507'

       ByteArray readHexFrom: '7a2bd507'
               => #[122 43 213 7]

Similarly these can be used for subclasses, e.g.,

       UUID new hex
               => '97c1f2ddf9209948b329319a30c16386'

       UUID readHexFrom: '97c1f2ddf9209948b329319a30c16386'
               => 97c1f2dd-f920-9948-b329-319a30c16386


Andreas Raab uploaded a new version of Multilingual to project The Trunk:
http://source.squeak.org/trunk/Multilingual-ar.87.mcz

==================== Summary ====================

Name: Multilingual-ar.87
Author: ar
Time: 11 February 2010, 11:48:33.736 pm
UUID: ca61be1a-7e30-2840-9b77-9cc7ecfc2d3f
Ancestors: Multilingual-ar.86

Change EncodedCharSet>>digitValue: to EncodedCharSet>>digitValueOf:. Part 3/3.

=============== Diff against Multilingual-ar.86 ===============

Item was changed:
 ----- Method: EncodedCharSet class>>digitValueOf: (in category 'class
methods') -----
 digitValueOf: char
       "Answer 0-9 if the receiver is $0-$9, 10-35 if it is $A-$Z, and < 0
       otherwise. This is used to parse literal numbers of radix 2-36."

       | value |
       value := char charCode.
+       value <= $9 asciiValue ifTrue:
+               [^value - $0 asciiValue].
+       value >= $A asciiValue ifTrue:
+               [value <= $Z asciiValue ifTrue: [^value - $A asciiValue + 10].
+                (value >= $a asciiValue and: [value <= $z asciiValue]) ifTrue:
+                       [^value - $a asciiValue + 10]].
-       value <= $9 asciiValue
-               ifTrue: [^value - $0 asciiValue].
-       value >= $A asciiValue
-               ifTrue: [value <= $Z asciiValue ifTrue: [^value - $A
asciiValue + 10]].
       ^ -1
 !

snip...



>>
>> --
>> Cesar Rabak
>>
>>
>> Em 24/02/2010 04:05, Stéphane Ducasse < stephane.ducasse at inria.fr > escreveu:
>>
>>> The main reason for not using lowercase in squeak was Dan extension of
>>> number with radix plus exponent.
>>> 16r8e7 -> 16r8 * (16 raisedTo: 7)
>>> and the Float variations...
>>>
>>> If you decided to abandon this notation, then go with either upper or lower.
>>> But a bit of consistency could help...
>>
>> I'm confused what is the situation now in squeak?
>> Because it seems that hex in squeak now prints and read lowercase?
>> So did
>> 16r8e7 and float
>> so will someone fix squeak to be consistent.
>> I'm a bit confused by the decision process in squeak (even if I should not worried too much).
>>
>> Stef
>> _______________________________________________
>> Pharo-project mailing list
>> Pharo-project at lists.gforge.inria.fr
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> Pharo-project at lists.gforge.inria.fr
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> Pharo-project at lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>




More information about the Pharo-dev mailing list