Question about RPackage (bug?)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Question about RPackage (bug?)

Mariano Martinez Peck
(MCWorkingCopy allManagers  collect: [:p | p package name] ) includes: 'RPackage' -> true

(RPackageOrganizer default packageNamed: 'RPackage') -> KeyNotFound

bug?


--
Mariano
http://marianopeck.wordpress.com

Reply | Threaded
Open this post in threaded view
|

Re: Question about RPackage (bug?)

Fernando olivero-2
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
<[hidden email]> wrote:

> (MCWorkingCopy allManagers  collect: [:p | p package name] ) includes: 'RPackage' -> true
>
> (RPackageOrganizer default packageNamed: 'RPackage') -> KeyNotFound
>
> bug?
>
>
> --
> Mariano
> http://marianopeck.wordpress.com
>

Reply | Threaded
Open this post in threaded view
|

Re: Question about RPackage (bug?)

Mariano Martinez Peck


On Thu, Aug 9, 2012 at 1:25 PM, Fernando Olivero <[hidden email]> 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
<[hidden email]> 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

Reply | Threaded
Open this post in threaded view
|

Re: Question about RPackage (bug?)

Fernando olivero-2
In reply to this post by Fernando olivero-2
You're right! But notice that the RPackage logic of one to one mapping
with categories, only
breaks   when it  only provides extension methods as in the case of
'AST-Core' and 'RPackage'.

| p |
p := RPackageOrganizer default packageNamed: 'AST-Core'.
( p extensionMethods size = 2 ) & ( p definedClasses size = 0 )

Only then, maybe this is a bug?


On Thu, Aug 9, 2012 at 1:52 PM, Mariano Martinez Peck
<[hidden email]> wrote:

>
>
> On Thu, Aug 9, 2012 at 1:25 PM, Fernando Olivero <[hidden email]<mailto:[hidden email]>> 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
> <[hidden email]<mailto:[hidden email]>> 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
>

Guy
Reply | Threaded
Open this post in threaded view
|

ScaledDecimal #printOn

Guy
In reply to this post by Fernando olivero-2
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.
.....
 

Reply | Threaded
Open this post in threaded view
|

Re: ScaledDecimal #printOn

Camillo Bruni-3
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 <[hidden email]> 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.
> .....
>
>


Guy
Reply | Threaded
Open this post in threaded view
|

Re: ScaledDecimal #printOn

Guy
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 <[hidden email]> 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.
>> .....
>>
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: Question about RPackage (bug?)

Stéphane Ducasse
In reply to this post by Mariano Martinez Peck

On Aug 9, 2012, at 12:24 PM, Mariano Martinez Peck wrote:

> (MCWorkingCopy allManagers  collect: [:p | p package name] ) includes: 'RPackage' -> true
>
> (RPackageOrganizer default packageNamed: 'RPackage') -> KeyNotFound

probably.
But again the import from the system to RPackageOrganizer has never been look at seriously.

>
> bug?
>
>
> --
> Mariano
> http://marianopeck.wordpress.com
>


Reply | Threaded
Open this post in threaded view
|

Re: Question about RPackage (bug?)

Stéphane Ducasse
In reply to this post by Fernando olivero-2

On Aug 9, 2012, at 4:50 PM, Fernando Olivero wrote:

> You're right! But notice that the RPackage logic of one to one mapping
> with categories, only
> breaks   when it  only provides extension methods as in the case of
> 'AST-Core' and 'RPackage'.
>
> | p |
> p := RPackageOrganizer default packageNamed: 'AST-Core'.
> ( p extensionMethods size = 2 ) & ( p definedClasses size = 0 )
>
> Only then, maybe this is a bug?

Yes
Now just that you know.
RPackage ****import**** (system -> rpackageOrganizer) was done with the idea that we would map a category to
a package.

Now we changed our mind, we will map a MCWorkingCopy to a RPAckage and categories will simply be class tags.

So if you want to get rpackage working as the default MCWorkingCopy, you have to change the import phase
or wait that we do it.

Now we should sync with ben because nautilus may be confused (and do not show class tags).

Stef




>
> On Thu, Aug 9, 2012 at 1:52 PM, Mariano Martinez Peck
> <[hidden email]> wrote:
>>
>>
>> On Thu, Aug 9, 2012 at 1:25 PM, Fernando Olivero <[hidden email]<mailto:[hidden email]>> 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
>> <[hidden email]<mailto:[hidden email]>> 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
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: ScaledDecimal #printOn

Stéphane Ducasse
In reply to this post by Guy
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 <[hidden email]> 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.
>>> .....
>>>
>>>
>>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Question about RPackage (bug?)

Guillermo Polito
In reply to this post by Stéphane Ducasse


On Fri, Aug 10, 2012 at 9:18 AM, Stéphane Ducasse <[hidden email]> wrote:

On Aug 9, 2012, at 4:50 PM, Fernando Olivero wrote:

> You're right! But notice that the RPackage logic of one to one mapping
> with categories, only
> breaks   when it  only provides extension methods as in the case of
> 'AST-Core' and 'RPackage'.
>
> | p |
> p := RPackageOrganizer default packageNamed: 'AST-Core'.
> ( p extensionMethods size = 2 ) & ( p definedClasses size = 0 )
>
> Only then, maybe this is a bug?

Yes
Now just that you know.
RPackage ****import**** (system -> rpackageOrganizer) was done with the idea that we would map a category to
a package.

Now we changed our mind, we will map a MCWorkingCopy to a RPAckage and categories will simply be class tags.

So if you want to get rpackage working as the default MCWorkingCopy, you have to change the import phase
or wait that we do it.

Now we should sync with ben because nautilus may be confused (and do not show class tags).

But the worse will be that Nautilus will show less packages, with more stuff :).
 

Stef




>
> On Thu, Aug 9, 2012 at 1:52 PM, Mariano Martinez Peck
> <[hidden email]> wrote:
>>
>>
>> On Thu, Aug 9, 2012 at 1:25 PM, Fernando Olivero <[hidden email]<mailto:[hidden email]>> 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
>> <[hidden email]<mailto:[hidden email]>> 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
>>
>



Reply | Threaded
Open this post in threaded view
|

Re: Question about RPackage (bug?)

EstebanLM
not if it is prepared :)

On Aug 10, 2012, at 9:57 AM, Guillermo Polito <[hidden email]> wrote:



On Fri, Aug 10, 2012 at 9:18 AM, Stéphane Ducasse <[hidden email]> wrote:

On Aug 9, 2012, at 4:50 PM, Fernando Olivero wrote:

> You're right! But notice that the RPackage logic of one to one mapping
> with categories, only
> breaks   when it  only provides extension methods as in the case of
> 'AST-Core' and 'RPackage'.
>
> | p |
> p := RPackageOrganizer default packageNamed: 'AST-Core'.
> ( p extensionMethods size = 2 ) & ( p definedClasses size = 0 )
>
> Only then, maybe this is a bug?

Yes
Now just that you know.
RPackage ****import**** (system -> rpackageOrganizer) was done with the idea that we would map a category to
a package.

Now we changed our mind, we will map a MCWorkingCopy to a RPAckage and categories will simply be class tags.

So if you want to get rpackage working as the default MCWorkingCopy, you have to change the import phase
or wait that we do it.

Now we should sync with ben because nautilus may be confused (and do not show class tags).

But the worse will be that Nautilus will show less packages, with more stuff :).
 

Stef




>
> On Thu, Aug 9, 2012 at 1:52 PM, Mariano Martinez Peck
> <[hidden email]> wrote:
>>
>>
>> On Thu, Aug 9, 2012 at 1:25 PM, Fernando Olivero <[hidden email]<mailto:[hidden email]>> 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
>> <[hidden email]<mailto:[hidden email]>> 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
>>
>