[Pharo-project] SLICE-RelicensingPart1
I went through all the changes proposed by this slice. I am not sure how should I review the code, but here is my try: - the new version of Character class>>codePoint: anInteger seems to have a different behavior: The old (current) code is codePoint: integer "Return a character whose encoding value is integer." #Fundmntl. (0 > integer or: [255 < integer]) ifTrue: [self error: 'parameter out of range 0..255']. ^ CharacterTable at: integer + 1 The new one is: codePoint: anInteger "Just for ANSI Compliance" ^self value: anInteger value: anInteger "Answer the Character whose value is anInteger." anInteger > 255 ifTrue: [^self basicNew setValue: anInteger]. ^ CharacterTable at: anInteger + 1. At the end an error is raised, but this is not the same. Was this review useful? Cheers, Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Indeed it may be useful to have the same verification. stef On May 27, 2009, at 1:51 PM, Alexandre Bergel wrote:
I went through all the changes proposed by this slice. I am not sure how should I review the code, but here is my try: - the new version of Character class>>codePoint: anInteger seems to have a different behavior: The old (current) code is codePoint: integer "Return a character whose encoding value is integer." #Fundmntl. (0 > integer or: [255 < integer]) ifTrue: [self error: 'parameter out of range 0..255']. ^ CharacterTable at: integer + 1
The new one is: codePoint: anInteger "Just for ANSI Compliance" ^self value: anInteger
value: anInteger "Answer the Character whose value is anInteger." anInteger > 255 ifTrue: [^self basicNew setValue: anInteger]. ^ CharacterTable at: anInteger + 1.
At the end an error is raised, but this is not the same.
Was this review useful?
Cheers, Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
The ANSI Specification doesn't mention anything about that the integer must be in some range... the only thing that expects is that (Character codePoint: x) codePoint = x .... anyway... I can add the verification... but that's not specified in the ANSI... anybody knowns some senders of this? I checked Pharo-Dev and found none.. maybe in the Web Image? Alexandre, how you obtain an error using value: ? given a negative argument? I tried with values greater than 255 and works in my image... Tonight I check that 2009/5/27 Alexandre Bergel <Alexandre.Bergel@inria.fr>
I went through all the changes proposed by this slice. I am not sure how should I review the code, but here is my try: - the new version of *Character class>>codePoint: anInteger *seems to have a different behavior: The old (current) code is *codePoint: integer * * **"Return a character whose encoding value is integer."* * **#Fundmntl.* * **(0 > integer or: [255 < integer])* * **ifTrue: [self error: 'parameter out of range 0..255'].* * **^ CharacterTable at: integer + 1*
The new one is: *codePoint: anInteger * * **"Just for ANSI Compliance"** * * **^self value: anInteger* *value: anInteger * * **"Answer the Character whose value is anInteger."* * **anInteger > 255 ifTrue: [^self basicNew setValue: anInteger].* * **^ CharacterTable at: anInteger + 1.*
At the end an error is raised, but this is not the same.
Was this review useful?
Cheers, Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Yes, with a negative argument. Adding the check: (0 > integer or: [255 < integer]) ifTrue: [self error: 'parameter out of range 0..255']. is probably enough. Alexandre On 27 May 2009, at 08:27, Gabriel Cotelli wrote:
The ANSI Specification doesn't mention anything about that the integer must be in some range... the only thing that expects is that (Character codePoint: x) codePoint = x ....
anyway... I can add the verification... but that's not specified in the ANSI... anybody knowns some senders of this? I checked Pharo-Dev and found none.. maybe in the Web Image?
Alexandre, how you obtain an error using value: ? given a negative argument? I tried with values greater than 255 and works in my image...
Tonight I check that
2009/5/27 Alexandre Bergel <Alexandre.Bergel@inria.fr> I went through all the changes proposed by this slice. I am not sure how should I review the code, but here is my try: - the new version of Character class>>codePoint: anInteger seems to have a different behavior: The old (current) code is codePoint: integer "Return a character whose encoding value is integer." #Fundmntl. (0 > integer or: [255 < integer]) ifTrue: [self error: 'parameter out of range 0..255']. ^ CharacterTable at: integer + 1
The new one is: codePoint: anInteger "Just for ANSI Compliance" ^self value: anInteger value: anInteger "Answer the Character whose value is anInteger." anInteger > 255 ifTrue: [^self basicNew setValue: anInteger]. ^ CharacterTable at: anInteger + 1.
At the end an error is raised, but this is not the same.
Was this review useful?
Cheers, Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Please remove the upper limit, I think this was a pre-internationalization method which should have been updated but was not because not used. For the lower limit, (CharacterTable at: anInteger + 1) in #value: already does the job of signalling the out of bound error, but yes, translation of the codePoint with this + 1 might be troubling. My POV is this one: Since #value: is responsible of possible mis-interpretation, #value: should handle disambiguation of the Error. That is a kind of encapsulation. I suggest error report be moved in #value:, not in every sender of #value: On the other hand, the test could eventually be omitted for efficiency reasons. Though, if efficiency really matters, I would rather see Character becoming immediate. Nicolas 2009/5/27 Alexandre Bergel <alexandre@bergel.eu>:
Yes, with a negative argument. Adding the check: Â (0 > integer or: [255 < integer]) ifTrue: [self error: 'parameter out of range 0..255']. is probably enough. Alexandre
On 27 May 2009, at 08:27, Gabriel Cotelli wrote:
The ANSI Specification doesn't mention anything about that the integer must be in some range... the only thing that expects is that (Character codePoint: x) codePoint = x ....
anyway... I can add the verification... but that's not specified in the ANSI... anybody knowns some senders of this? I checked Pharo-Dev and found none.. maybe in the Web Image?
Alexandre, how you obtain an error using value: ? given a negative argument? I tried with values greater than 255 and works in my image...
Tonight I check that
2009/5/27 Alexandre Bergel <Alexandre.Bergel@inria.fr> I went through all the changes proposed by this slice. I am not sure how should I review the code, but here is my try: - the new version of Character class>>codePoint: anInteger seems to have a different behavior: The old (current) code is codePoint: integer "Return a character whose encoding value is integer." #Fundmntl. (0 > integer or: [255 < integer]) ifTrue: [self error: 'parameter out of range 0..255']. ^ CharacterTable at: integer + 1 The new one is: codePoint: anInteger "Just for ANSI Compliance" ^self value: anInteger value: anInteger "Answer the Character whose value is anInteger." anInteger > 255 ifTrue: [^self basicNew setValue: anInteger]. ^ CharacterTable at: anInteger + 1. At the end an error is raised, but this is not the same. Was this review useful? Cheers, Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel  http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel  http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Please remove the upper limit, I think this was a pre-internationalization method which should have been updated but was not because not used.
But CharacterTable is an array of 256 characters long. Alexandre
2009/5/27 Alexandre Bergel <alexandre@bergel.eu>:
Yes, with a negative argument. Adding the check: (0 > integer or: [255 < integer]) ifTrue: [self error: 'parameter out of range 0..255']. is probably enough. Alexandre
On 27 May 2009, at 08:27, Gabriel Cotelli wrote:
The ANSI Specification doesn't mention anything about that the integer must be in some range... the only thing that expects is that (Character codePoint: x) codePoint = x ....
anyway... I can add the verification... but that's not specified in the ANSI... anybody knowns some senders of this? I checked Pharo-Dev and found none.. maybe in the Web Image?
Alexandre, how you obtain an error using value: ? given a negative argument? I tried with values greater than 255 and works in my image...
Tonight I check that
2009/5/27 Alexandre Bergel <Alexandre.Bergel@inria.fr> I went through all the changes proposed by this slice. I am not sure how should I review the code, but here is my try: - the new version of Character class>>codePoint: anInteger seems to have a different behavior: The old (current) code is codePoint: integer "Return a character whose encoding value is integer." #Fundmntl. (0 > integer or: [255 < integer]) ifTrue: [self error: 'parameter out of range 0..255']. ^ CharacterTable at: integer + 1 The new one is: codePoint: anInteger "Just for ANSI Compliance" ^self value: anInteger value: anInteger "Answer the Character whose value is anInteger." anInteger > 255 ifTrue: [^self basicNew setValue: anInteger]. ^ CharacterTable at: anInteger + 1. At the end an error is raised, but this is not the same. Was this review useful? Cheers, Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Yes, but if "value:" cannot lookup in the table uses some extended character set... I think the negative check mut be done... about the > 255 I'm not sure... On Wed, May 27, 2009 at 3:42 PM, Alexandre Bergel <alexandre@bergel.eu>wrote:
Please remove the upper limit, I think this was a pre-internationalization method which should have been updated but was not because not used.
But CharacterTable is an array of 256 characters long.
Alexandre
2009/5/27 Alexandre Bergel <alexandre@bergel.eu>:
Yes, with a negative argument. Adding the check: (0 > integer or: [255 < integer]) ifTrue: [self error: 'parameter out of range 0..255']. is probably enough. Alexandre
On 27 May 2009, at 08:27, Gabriel Cotelli wrote:
The ANSI Specification doesn't mention anything about that the integer must be in some range... the only thing that expects is that (Character codePoint: x) codePoint = x ....
anyway... I can add the verification... but that's not specified in the ANSI... anybody knowns some senders of this? I checked Pharo-Dev and found none.. maybe in the Web Image?
Alexandre, how you obtain an error using value: ? given a negative argument? I tried with values greater than 255 and works in my image...
Tonight I check that
2009/5/27 Alexandre Bergel <Alexandre.Bergel@inria.fr> I went through all the changes proposed by this slice. I am not sure how should I review the code, but here is my try: - the new version of Character class>>codePoint: anInteger seems to have a different behavior: The old (current) code is codePoint: integer "Return a character whose encoding value is integer." #Fundmntl. (0 > integer or: [255 < integer]) ifTrue: [self error: 'parameter out of range 0..255']. ^ CharacterTable at: integer + 1 The new one is: codePoint: anInteger "Just for ANSI Compliance" ^self value: anInteger value: anInteger "Answer the Character whose value is anInteger." anInteger > 255 ifTrue: [^self basicNew setValue: anInteger]. ^ CharacterTable at: anInteger + 1. At the end an error is raised, but this is not the same. Was this review useful? Cheers, Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
I agree with what has been previously said. However, I think there is a fundamental difference between getting en error: 'Character code point ranges between 1 and 256 only' and 'subscript is out of bound'. Currently, CharacterTable has 256 slots. Maybe an initialization has to be done or something, but if you provide a value > 255, then you will get an error. Alexandre On 27 May 2009, at 17:26, Gabriel Cotelli wrote:
Yes, but if "value:" cannot lookup in the table uses some extended character set...
I think the negative check mut be done... about the > 255 I'm not sure...
On Wed, May 27, 2009 at 3:42 PM, Alexandre Bergel <alexandre@bergel.eu> wrote:
Please remove the upper limit, I think this was a pre-internationalization method which should have been updated but was not because not used.
But CharacterTable is an array of 256 characters long.
Alexandre
2009/5/27 Alexandre Bergel <alexandre@bergel.eu>:
Yes, with a negative argument. Adding the check: (0 > integer or: [255 < integer]) ifTrue: [self error: 'parameter out of range 0..255']. is probably enough. Alexandre
On 27 May 2009, at 08:27, Gabriel Cotelli wrote:
The ANSI Specification doesn't mention anything about that the integer must be in some range... the only thing that expects is that (Character codePoint: x) codePoint = x ....
anyway... I can add the verification... but that's not specified in the ANSI... anybody knowns some senders of this? I checked Pharo-Dev and found none.. maybe in the Web Image?
Alexandre, how you obtain an error using value: ? given a negative argument? I tried with values greater than 255 and works in my image...
Tonight I check that
2009/5/27 Alexandre Bergel <Alexandre.Bergel@inria.fr> I went through all the changes proposed by this slice. I am not sure how should I review the code, but here is my try: - the new version of Character class>>codePoint: anInteger seems to have a different behavior: The old (current) code is codePoint: integer "Return a character whose encoding value is integer." #Fundmntl. (0 > integer or: [255 < integer]) ifTrue: [self error: 'parameter out of range 0..255']. ^ CharacterTable at: integer + 1 The new one is: codePoint: anInteger "Just for ANSI Compliance" ^self value: anInteger value: anInteger "Answer the Character whose value is anInteger." anInteger > 255 ifTrue: [^self basicNew setValue: anInteger]. ^ CharacterTable at: anInteger + 1. At the end an error is raised, but this is not the same. Was this review useful? Cheers, Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Hi Alexandre, I agree that it's better to get the exact error. So I think the negative check is necessary, however Character class>>value: works in my image for values greater than 255 (Character value: 257) = $? ... I don't known if there's un upper limit to this or if depends on the character set... Character class>>value: already checks for > 255 and in that case don't use the table.... The <0 assertion must be done. So if it's ok I want to do this: Retain Character class>>codePoint: anInteger ^self value: anInteger And change Character class>>value: anInteger to perform the negative check and raise a better error in that case... the >255 case don't raises an error (at least not always) so I open to suggestions... Any comments are welcome. Thanks for the help, Gabriel On Wed, May 27, 2009 at 6:33 PM, Alexandre Bergel <alexandre@bergel.eu>wrote:
I agree with what has been previously said. However, I think there is a fundamental difference between getting en error: 'Character code point ranges between 1 and 256 only' and 'subscript is out of bound'. Currently, CharacterTable has 256 slots. Maybe an initialization has to be done or something, but if you provide a value > 255, then you will get an error.
Alexandre
On 27 May 2009, at 17:26, Gabriel Cotelli wrote:
Yes, but if "value:" cannot lookup in the table uses some extended character set...
I think the negative check mut be done... about the > 255 I'm not sure...
On Wed, May 27, 2009 at 3:42 PM, Alexandre Bergel <alexandre@bergel.eu> wrote:
Please remove the upper limit, I think this was a pre-internationalization method which should have been updated but was not because not used.
But CharacterTable is an array of 256 characters long.
Alexandre
2009/5/27 Alexandre Bergel <alexandre@bergel.eu>:
Yes, with a negative argument. Adding the check: (0 > integer or: [255 < integer]) ifTrue: [self error: 'parameter out of range 0..255']. is probably enough. Alexandre
On 27 May 2009, at 08:27, Gabriel Cotelli wrote:
The ANSI Specification doesn't mention anything about that the integer must be in some range... the only thing that expects is that (Character codePoint: x) codePoint = x ....
anyway... I can add the verification... but that's not specified in the ANSI... anybody knowns some senders of this? I checked Pharo-Dev and found none.. maybe in the Web Image?
Alexandre, how you obtain an error using value: ? given a negative argument? I tried with values greater than 255 and works in my image...
Tonight I check that
2009/5/27 Alexandre Bergel <Alexandre.Bergel@inria.fr> I went through all the changes proposed by this slice. I am not sure how should I review the code, but here is my try: - the new version of Character class>>codePoint: anInteger seems to have a different behavior: The old (current) code is codePoint: integer "Return a character whose encoding value is integer." #Fundmntl. (0 > integer or: [255 < integer]) ifTrue: [self error: 'parameter out of range 0..255']. ^ CharacterTable at: integer + 1 The new one is: codePoint: anInteger "Just for ANSI Compliance" ^self value: anInteger value: anInteger "Answer the Character whose value is anInteger." anInteger > 255 ifTrue: [^self basicNew setValue: anInteger]. ^ CharacterTable at: anInteger + 1. At the end an error is raised, but this is not the same. Was this review useful? Cheers, Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
2009/5/28 Gabriel Cotelli <g.cotelli@gmail.com>:
Hi Alexandre,
I agree that it's better to get the exact error. So I think the negative check is necessary, however Character class>>value: works in my image for values greater than 255 (Character value: 257) = $? ... I don't known if there's un upper limit to this or if depends on the character set...
Character class>>value: already checks for > 255 and in that case don't use the table....
The <0 assertion must be done.
So if it's ok I want to do this:
Retain Character class>>codePoint: anInteger ^self value: anInteger
And change Character class>>value: anInteger
to perform the negative check and raise a better error in that case... the >255 case don't raises an error (at least not always) so I open to suggestions...
Any comments are welcome.
Yes, that is exactly what I tried to explain :) Nicolas
Thanks for the help, Gabriel
On Wed, May 27, 2009 at 6:33 PM, Alexandre Bergel <alexandre@bergel.eu> wrote:
I agree with what has been previously said. However, I think there is a fundamental difference between getting en error: 'Character code point ranges between 1 and 256 only' and 'subscript is out of bound'. Currently, CharacterTable has 256 slots. Maybe an initialization has to be done or something, but if you provide a value > 255, then you will get an error.
Alexandre
On 27 May 2009, at 17:26, Gabriel Cotelli wrote:
Yes, but if "value:" cannot lookup in the table uses some extended character set...
I think the negative check mut be done... about the > 255 I'm not sure...
On Wed, May 27, 2009 at 3:42 PM, Alexandre Bergel <alexandre@bergel.eu> wrote:
Please remove the upper limit, I think this was a pre-internationalization method which should have been updated but was not because not used.
But CharacterTable is an array of 256 characters long.
Alexandre
2009/5/27 Alexandre Bergel <alexandre@bergel.eu>:
Yes, with a negative argument. Adding the check: Â (0 > integer or: [255 < integer]) ifTrue: [self error: 'parameter out of range 0..255']. is probably enough. Alexandre
On 27 May 2009, at 08:27, Gabriel Cotelli wrote:
The ANSI Specification doesn't mention anything about that the integer must be in some range... the only thing that expects is that (Character codePoint: x) codePoint = x ....
anyway... I can add the verification... but that's not specified in the ANSI... anybody knowns some senders of this? I checked Pharo-Dev and found none.. maybe in the Web Image?
Alexandre, how you obtain an error using value: ? given a negative argument? I tried with values greater than 255 and works in my image...
Tonight I check that
2009/5/27 Alexandre Bergel <Alexandre.Bergel@inria.fr> I went through all the changes proposed by this slice. I am not sure how should I review the code, but here is my try: - the new version of Character class>>codePoint: anInteger seems to have a different behavior: The old (current) code is codePoint: integer "Return a character whose encoding value is integer." #Fundmntl. (0 > integer or: [255 < integer]) ifTrue: [self error: 'parameter out of range 0..255']. ^ CharacterTable at: integer + 1 The new one is: codePoint: anInteger "Just for ANSI Compliance" ^self value: anInteger value: anInteger "Answer the Character whose value is anInteger." anInteger > 255 ifTrue: [^self basicNew setValue: anInteger]. ^ CharacterTable at: anInteger + 1. At the end an error is raised, but this is not the same. Was this review useful? Cheers, Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel  http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel  http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel  http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel  http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
I agree Character class>>value: accepts values above 256, we were talking about codePoint: however. Maybe codePoint is obsolete and should be removed. There is sender in a last Pharo + Mondrian + Moose + other stuffs. Side node. This is very strange, using a DejaVu font, I can printIt "Character value: 300". But printint-It "Character value: 257" takes forever. I am the only one? If not, then I open a ticket.
The <0 assertion must be done.
An error saying that character values cannot be negative would be helpful.
So if it's ok I want to do this:
Retain Character class>>codePoint: anInteger ^self value: anInteger
And change Character class>>value: anInteger
to perform the negative check and raise a better error in that case... the >255 case don't raises an error (at least not always) so I open to suggestions...
Looks good to me.
Thanks for the help,
Glad it helped Alexandre
On Wed, May 27, 2009 at 6:33 PM, Alexandre Bergel <alexandre@bergel.eu> wrote: I agree with what has been previously said. However, I think there is a fundamental difference between getting en error: 'Character code point ranges between 1 and 256 only' and 'subscript is out of bound'. Currently, CharacterTable has 256 slots. Maybe an initialization has to be done or something, but if you provide a value > 255, then you will get an error.
Alexandre
On 27 May 2009, at 17:26, Gabriel Cotelli wrote:
Yes, but if "value:" cannot lookup in the table uses some extended character set...
I think the negative check mut be done... about the > 255 I'm not sure...
On Wed, May 27, 2009 at 3:42 PM, Alexandre Bergel <alexandre@bergel.eu> wrote:
Please remove the upper limit, I think this was a pre-internationalization method which should have been updated but was not because not used.
But CharacterTable is an array of 256 characters long.
Alexandre
2009/5/27 Alexandre Bergel <alexandre@bergel.eu>:
Yes, with a negative argument. Adding the check: (0 > integer or: [255 < integer]) ifTrue: [self error: 'parameter out of range 0..255']. is probably enough. Alexandre
On 27 May 2009, at 08:27, Gabriel Cotelli wrote:
The ANSI Specification doesn't mention anything about that the integer must be in some range... the only thing that expects is that
(Character
codePoint: x) codePoint = x ....
anyway... I can add the verification... but that's not specified in the ANSI... anybody knowns some senders of this? I checked Pharo-Dev and found none.. maybe in the Web Image?
Alexandre, how you obtain an error using value: ? given a negative argument? I tried with values greater than 255 and works in my image...
Tonight I check that
2009/5/27 Alexandre Bergel <Alexandre.Bergel@inria.fr> I went through all the changes proposed by this slice. I am not sure how should I review the code, but here is my try: - the new version of Character class>>codePoint: anInteger seems to have a different behavior: The old (current) code is codePoint: integer "Return a character whose encoding value is integer." #Fundmntl. (0 > integer or: [255 < integer]) ifTrue: [self error: 'parameter out of range 0..255']. ^ CharacterTable at: integer + 1 The new one is: codePoint: anInteger "Just for ANSI Compliance" ^self value: anInteger value: anInteger "Answer the Character whose value is anInteger." anInteger > 255 ifTrue: [^self basicNew setValue: anInteger]. ^ CharacterTable at: anInteger + 1. At the end an error is raised, but this is not the same. Was this review useful? Cheers, Alexandre -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo- project
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Maybe codePoint is obsolete and should be removed. There is sender in a last Pharo + Mondrian + Moose + other stuffs.
No, It is part of ANSI. The following invariant must hold for all values of the character set: (Character codePoint: anInteger) codePoint = anInteger Lukas -- Lukas Renggli http://www.lukas-renggli.ch
I am aware this is part of ANSI. My thought behind my email was that if nobody uses it, then this method could be moved into a package ANSI that can be separately loaded. I think this goes along the goal to remove junk from the base image. However, if there are users of this method, then it fully deserves to stay in Core. Cheers, Alexandre On 28 May 2009, at 11:48, Lukas Renggli wrote:
Maybe codePoint is obsolete and should be removed. There is sender in a last Pharo + Mondrian + Moose + other stuffs.
No, It is part of ANSI.
The following invariant must hold for all values of the character set:
(Character codePoint: anInteger) codePoint = anInteger
Lukas
-- Lukas Renggli http://www.lukas-renggli.ch
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
I am aware this is part of ANSI. My thought behind my email was that if nobody uses it, then this method could be moved into a package ANSI that can be separately loaded.
Cool, then we also get rid of OrderedCollection? Lukas -- Lukas Renggli http://www.lukas-renggli.ch
On May 28, 2009, at 18:16 , Lukas Renggli wrote:
I am aware this is part of ANSI. My thought behind my email was that if nobody uses it, then this method could be moved into a package ANSI that can be separately loaded.
Cool, then we also get rid of OrderedCollection?
So you are saying that nobody is using OrderedCollection? But seriously, this sort of mails are unhelpful. Adrian
Well I think a statement of direction is required. Is *all* ANSI specific logic going to be in the base Pharo? Is base Pharo going to be ANSI compliant ? I don't think people want to load chunks of it from here and there, assuming they know they need to do that. On Thu, May 28, 2009 at 12:30 PM, Adrian Lienhard <adi@netstyle.ch> wrote: -- =========================================================================== John M. McIntosh <johnmci@smalltalkconsulting.com> Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com ===========================================================================
On May 28, 2009, at 21:41 , John McIntosh wrote:
Well I think a statement of direction is required. Is *all* ANSI specific logic going to be in the base Pharo? Is base Pharo going to be ANSI compliant ? I don't think people want to load chunks of it from here and there, assuming they know they need to do that.
I see it like this: - keep already existing ANSI compliant behavior - where appropriate, fix semantics to be compliant - where appropriate, add new ANSI behavior Full compliance, on the other hand, is not a primary goal. Cheers, Adrian
Yes. The key problem with lot of packages is that they can rot and be forgotten. I think that at one point we should arrive to a system where lot of code is in package but we work on a system where they are automatically/ easily loadable. Stef On May 28, 2009, at 10:02 PM, Adrian Lienhard wrote:
On May 28, 2009, at 21:41 , John McIntosh wrote:
Well I think a statement of direction is required. Is *all* ANSI specific logic going to be in the base Pharo? Is base Pharo going to be ANSI compliant ? I don't think people want to load chunks of it from here and there, assuming they know they need to do that.
I see it like this:
- keep already existing ANSI compliant behavior - where appropriate, fix semantics to be compliant - where appropriate, add new ANSI behavior
Full compliance, on the other hand, is not a primary goal.
Cheers, Adrian
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Full compliance, on the other hand, is not a primary goal.
ANSI Smalltalk is nominal. Too minimal for many tasks, and still people build their frameworks on these foundations to keep their code portable across platforms. If you undermine the Smalltalk standard, Pharo simply can't be the choice for open-source development anymore. Full ANSI compliance must a primary goal. Lukas -- Lukas Renggli http://www.lukas-renggli.ch
<OT>
Full ANSI compliance must a primary goal.
I politely disagree. ANSI is the least common denominator, the worst of all possible solutions. Just look at German pre-election politics right now and what you get is ANSI. it should be a loadable package, but not be driving design decisions. Just MTM (my two marks, when it still was worth something, like the Swiss Franks back then ;-) ) michael
It's a matter of priorities. We decided for instance that license cleaning, closures, and making all tests green is more important than ANSI compliance. Of course, we could add stuff like ANSI to the list, but then we will never deliver, not event a first version, because there is always something important to be done. Its not a question of will, but of resources. If people feel that Pharo cannot be used because its not compliant they are welcome to provide improvements. If people feel that Pharo cannot be used because its not compliant and they are not able to provide improvements then they can simply choose something else. Adrian On May 28, 2009, at 22:29 , Lukas Renggli wrote:
Full compliance, on the other hand, is not a primary goal.
ANSI Smalltalk is nominal. Too minimal for many tasks, and still people build their frameworks on these foundations to keep their code portable across platforms. If you undermine the Smalltalk standard, Pharo simply can't be the choice for open-source development anymore. Full ANSI compliance must a primary goal.
Lukas
-- Lukas Renggli http://www.lukas-renggli.ch
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
On Thu, May 28, 2009 at 10:56 PM, Adrian Lienhard <adi@netstyle.ch> wrote:
It's a matter of priorities. We decided for instance that license cleaning, closures, and making all tests green is more important than ANSI compliance. Of course, we could add stuff like ANSI to the list, but then we will never deliver, not event a first version, because
so the comprise for now would be to at least not actively remove methods/classes that are part of the ANSI standard? Michael
so the comprise for now would be to at least not actively remove methods/classes that are part of the  ANSI standard?
Yes, this is exactly what I was asking for. I did not suggest to add new features. Squeak 3.9 already has a pretty good ANSI compliance. Lukas -- Lukas Renggli http://www.lukas-renggli.ch
On Thu, May 28, 2009 at 11:06 PM, Lukas Renggli <renggli@gmail.com> wrote:
so the comprise for now would be to at least not actively remove methods/classes that are part of the  ANSI standard?
Yes, this is exactly what I was asking for. I did not suggest to add new features. Squeak 3.9 already has a pretty good ANSI compliance.
Always remember that sarcasm doesn't translate well into other languages or cultures. My first and pretty much most embarrassing realization when first traveling to Japan. Not counting all the other screw-ups that I probably didn't even realize... michael
On Thu, May 28, 2009 at 11:32 PM, Yoshiki Ohshima <yoshiki@vpri.org> wrote:
At Thu, 28 May 2009 23:12:23 +0200, Michael Rueger wrote:
My first and pretty much most embarrassing realization when first traveling to Japan.
 What happened?
When arriving at Kansai (Osaka airport) the trains were shut down due to a storm (don't ask about how the flight went ;-) ). When the girl at the information booth told me that I would need to take the bus (which takes 3h instead of 90min IIRC) I said " I guess i have no other choice". After a while I realized that she had started to look for other choices for me... At last we both realized what happened and had a good laugh ;-) Very humbling experience... Michael
On May 28, 2009, at 23:06 , Lukas Renggli wrote:
so the comprise for now would be to at least not actively remove methods/classes that are part of the ANSI standard?
Yes.
Yes, this is exactly what I was asking for. I did not suggest to add new features. Squeak 3.9 already has a pretty good ANSI compliance.
This is exactly what I said one hour ago: "- keep already existing ANSI compliant behavior" I don't understand why you reply with "If you undermine the Smalltalk standard" etc. So, it seems, we agree. Adrian
participants (10)
-
Adrian Lienhard -
Alexandre Bergel -
Alexandre Bergel -
Gabriel Cotelli -
John McIntosh -
Lukas Renggli -
Michael Rueger -
Nicolas Cellier -
Stéphane Ducasse -
Yoshiki Ohshima