Re: [Pharo-project] Question about RPackage (bug?)
Hi Mariano, I've been using RPackage so i stumbled on the same "problem". RPackage maps System Categories (one to one), thus your problem happens because there's no category named 'RPackage'. For example evaluate (RPackageOrganizer default packageNamed: 'RPackage-Core') Saludos, Fernando On Thu, Aug 9, 2012 at 12:24 PM, Mariano Martinez Peck <marianopeck@gmail.com> wrote:
(MCWorkingCopy allManagers collect: [:p | p package name] ) includes: 'RPackage' -> true
(RPackageOrganizer default packageNamed: 'RPackage') -> KeyNotFound
bug?
-- Mariano http://marianopeck.wordpress.com
On Thu, Aug 9, 2012 at 1:25 PM, Fernando Olivero <fernando.olivero@usi.ch>wrote:
Hi Mariano,
I've been using RPackage so i stumbled on the same "problem". RPackage maps System Categories (one to one), thus your problem happens because there's no category named 'RPackage'.
But for the rest it works. For example: (RPackageOrganizer default packageNamed: 'AST-Core') And there is no category 'AST-Core'. Moreover, I have just discovered that if I evaluate: RPackageOrganizer initialize. Then it appears :)
For example evaluate (RPackageOrganizer default packageNamed: 'RPackage-Core')
Saludos, Fernando
On Thu, Aug 9, 2012 at 12:24 PM, Mariano Martinez Peck <marianopeck@gmail.com> wrote:
(MCWorkingCopy allManagers collect: [:p | p package name] ) includes: 'RPackage' -> true
(RPackageOrganizer default packageNamed: 'RPackage') -> KeyNotFound
bug?
-- Mariano http://marianopeck.wordpress.com
-- Mariano http://marianopeck.wordpress.com
Team Pharo, The printOn: method in ScaledDecimal returns a positive number string where the number is >-1 and < 0. For example -0.55s2 returns a string '0.55s2'. I have made my own correction. This may help the one other person who is using ScaledDecimal as a proxy for Currency but I have no idea what to do with this astounding discovery nor whether it will help anyone nor indeed if it is very tidy code. Thanks Guy Bloomfield The current method starts with the string for the integer part 0 and then the absolute value of the fraction: printOn: aStream "Append an approximated representation of the receiver on aStream. Use prescribed number of digits after decimal point (the scale) using a rounding operation if not exact" | fractionPart | scale = 0 ifTrue: [self rounded printOn: aStream] ifFalse: [self integerPart printOn: aStream. aStream nextPut: $.. fractionPart := (self abs fractionPart * (10 raisedToInteger: scale)) rounded. ..... My correction: printOn: aStream "Append an approximated representation of the receiver on aStream. Use prescribed number of digits after decimal point (the scale) using a rounding operation if not exact" | fractionPart | self < 0 ifTrue: [ aStream nextPut: $- ]. scale = 0 ifTrue: [self rounded printOn: aStream] ifFalse: [self abs integerPart printOn: aStream. aStream nextPut: $.. fractionPart := (self abs fractionPart * (10 raisedToInteger: scale)) rounded. .....
which version of Pharo/VM are you using? Cause in my latest 1.4 and latest 2.0 this seems to work... String streamContents: [ :s| -0.55s2 printOn: s ] "yields the expected '-0.55s2'" I remember Mariano once had a strange integer issue since he accidentally used once of is own compiled VMs which wasn't working as expected. best cami On 2012-08-09, at 23:53, Guy <guy@healthqualitynz.com> wrote:
Team Pharo, The printOn: method in ScaledDecimal returns a positive number string where the number is >-1 and < 0. For example -0.55s2 returns a string '0.55s2'.
I have made my own correction.
This may help the one other person who is using ScaledDecimal as a proxy for Currency but I have no idea what to do with this astounding discovery nor whether it will help anyone nor indeed if it is very tidy code.
Thanks
Guy Bloomfield
The current method starts with the string for the integer part 0 and then the absolute value of the fraction:
printOn: aStream "Append an approximated representation of the receiver on aStream. Use prescribed number of digits after decimal point (the scale) using a rounding operation if not exact"
| fractionPart | scale = 0 ifTrue: [self rounded printOn: aStream] ifFalse: [self integerPart printOn: aStream. aStream nextPut: $.. fractionPart := (self abs fractionPart * (10 raisedToInteger: scale)) rounded. .....
My correction:
printOn: aStream "Append an approximated representation of the receiver on aStream. Use prescribed number of digits after decimal point (the scale) using a rounding operation if not exact"
| fractionPart |
self < 0 ifTrue: [ aStream nextPut: $- ].
scale = 0 ifTrue: [self rounded printOn: aStream] ifFalse: [self abs integerPart printOn: aStream. aStream nextPut: $.. fractionPart := (self abs fractionPart * (10 raisedToInteger: scale)) rounded. .....
Cami, Silly me 1.1.1. I should obviously be up to date. Thanks Guy On 10/08/2012, at 10:04 AM, Camillo Bruni wrote:
which version of Pharo/VM are you using? Cause in my latest 1.4 and latest 2.0 this seems to work...
String streamContents: [ :s| -0.55s2 printOn: s ] "yields the expected '-0.55s2'"
I remember Mariano once had a strange integer issue since he accidentally used once of is own compiled VMs which wasn't working as expected.
best cami
On 2012-08-09, at 23:53, Guy <guy@healthqualitynz.com> wrote:
Team Pharo, The printOn: method in ScaledDecimal returns a positive number string where the number is >-1 and < 0. For example -0.55s2 returns a string '0.55s2'.
I have made my own correction.
This may help the one other person who is using ScaledDecimal as a proxy for Currency but I have no idea what to do with this astounding discovery nor whether it will help anyone nor indeed if it is very tidy code.
Thanks
Guy Bloomfield
The current method starts with the string for the integer part 0 and then the absolute value of the fraction:
printOn: aStream "Append an approximated representation of the receiver on aStream. Use prescribed number of digits after decimal point (the scale) using a rounding operation if not exact"
| fractionPart | scale = 0 ifTrue: [self rounded printOn: aStream] ifFalse: [self integerPart printOn: aStream. aStream nextPut: $.. fractionPart := (self abs fractionPart * (10 raisedToInteger: scale)) rounded. .....
My correction:
printOn: aStream "Append an approximated representation of the receiver on aStream. Use prescribed number of digits after decimal point (the scale) using a rounding operation if not exact"
| fractionPart |
self < 0 ifTrue: [ aStream nextPut: $- ].
scale = 0 ifTrue: [self rounded printOn: aStream] ifFalse: [self abs integerPart printOn: aStream. aStream nextPut: $.. fractionPart := (self abs fractionPart * (10 raisedToInteger: scale)) rounded. .....
please please please update to 1.4 because we improved a lottttttttt and even more :) On Aug 10, 2012, at 12:12 AM, Guy wrote:
Cami, Silly me 1.1.1. I should obviously be up to date.
Thanks
Guy
On 10/08/2012, at 10:04 AM, Camillo Bruni wrote:
which version of Pharo/VM are you using? Cause in my latest 1.4 and latest 2.0 this seems to work...
String streamContents: [ :s| -0.55s2 printOn: s ] "yields the expected '-0.55s2'"
I remember Mariano once had a strange integer issue since he accidentally used once of is own compiled VMs which wasn't working as expected.
best cami
On 2012-08-09, at 23:53, Guy <guy@healthqualitynz.com> wrote:
Team Pharo, The printOn: method in ScaledDecimal returns a positive number string where the number is >-1 and < 0. For example -0.55s2 returns a string '0.55s2'.
I have made my own correction.
This may help the one other person who is using ScaledDecimal as a proxy for Currency but I have no idea what to do with this astounding discovery nor whether it will help anyone nor indeed if it is very tidy code.
Thanks
Guy Bloomfield
The current method starts with the string for the integer part 0 and then the absolute value of the fraction:
printOn: aStream "Append an approximated representation of the receiver on aStream. Use prescribed number of digits after decimal point (the scale) using a rounding operation if not exact"
| fractionPart | scale = 0 ifTrue: [self rounded printOn: aStream] ifFalse: [self integerPart printOn: aStream. aStream nextPut: $.. fractionPart := (self abs fractionPart * (10 raisedToInteger: scale)) rounded. .....
My correction:
printOn: aStream "Append an approximated representation of the receiver on aStream. Use prescribed number of digits after decimal point (the scale) using a rounding operation if not exact"
| fractionPart |
self < 0 ifTrue: [ aStream nextPut: $- ].
scale = 0 ifTrue: [self rounded printOn: aStream] ifFalse: [self abs integerPart printOn: aStream. aStream nextPut: $.. fractionPart := (self abs fractionPart * (10 raisedToInteger: scale)) rounded. .....
participants (5)
-
Camillo Bruni -
Fernando Olivero -
Guy -
Mariano Martinez Peck -
Stéphane Ducasse