The Trunk: Kernel-pre.1105.mcz

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

The Trunk: Kernel-pre.1105.mcz

commits-2
Patrick Rein uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-pre.1105.mcz

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

Name: Kernel-pre.1105
Author: pre
Time: 19 May 2017, 2:22:29.00196 pm
UUID: 7e22498c-7586-584c-a2a9-81331c572590
Ancestors: Kernel-pre.1104

Removes a redundancy in CompiledCode.

=============== Diff against Kernel-nice.1103 ===============

Item was changed:
  ----- Method: CompiledCode class>>headerFlagForEncoder: (in category 'method encoding') -----
  headerFlagForEncoder: anEncoder
- anEncoder class == PrimaryBytecodeSetEncoderClass ifTrue:
- [^0].
- anEncoder class == SecondaryBytecodeSetEncoderClass ifTrue:
- [^SmallInteger minVal].
  "This allows subclasses for compiler variants such as the ScriptEncoder in EToys
  to continue to function."
+ (anEncoder isKindOf: PrimaryBytecodeSetEncoderClass) ifTrue:
- (anEncoder class inheritsFrom: PrimaryBytecodeSetEncoderClass) ifTrue:
  [^0].
+ (anEncoder isKindOf: SecondaryBytecodeSetEncoderClass) ifTrue:
- (anEncoder class inheritsFrom: SecondaryBytecodeSetEncoderClass) ifTrue:
  [^SmallInteger minVal].
  self error: 'The encoder is not one of the two installed bytecode sets'!

Item was added:
+ ----- Method: Number>>** (in category 'mathematical functions') -----
+ ** aNumber
+
+ ^ self raisedTo: aNumber!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Kernel-pre.1105.mcz

Nicolas Cellier


2017-05-19 14:22 GMT+02:00 <[hidden email]>:
Patrick Rein uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-pre.1105.mcz

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

Name: Kernel-pre.1105
Author: pre
Time: 19 May 2017, 2:22:29.00196 pm
UUID: 7e22498c-7586-584c-a2a9-81331c572590
Ancestors: Kernel-pre.1104

Removes a redundancy in CompiledCode.

=============== Diff against Kernel-nice.1103 ===============

Item was changed:
  ----- Method: CompiledCode class>>headerFlagForEncoder: (in category 'method encoding') -----
  headerFlagForEncoder: anEncoder
-       anEncoder class == PrimaryBytecodeSetEncoderClass ifTrue:
-               [^0].
-       anEncoder class == SecondaryBytecodeSetEncoderClass ifTrue:
-               [^SmallInteger minVal].
        "This allows subclasses for compiler variants such as the ScriptEncoder in EToys
         to continue to function."
+       (anEncoder isKindOf: PrimaryBytecodeSetEncoderClass) ifTrue:
-       (anEncoder class inheritsFrom: PrimaryBytecodeSetEncoderClass) ifTrue:
                [^0].
+       (anEncoder isKindOf: SecondaryBytecodeSetEncoderClass) ifTrue:
-       (anEncoder class inheritsFrom: SecondaryBytecodeSetEncoderClass) ifTrue:
                [^SmallInteger minVal].
        self error: 'The encoder is not one of the two installed bytecode sets'!

Then why not send a message back to anEncoder?
Way more efficient than testing classes sequentially and recursively...
 
Item was added:
+ ----- Method: Number>>** (in category 'mathematical functions') -----
+ ** aNumber
+
+       ^ self raisedTo: aNumber!

Above change can't both be waiting in inbox and be commited to trunk



Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Kernel-pre.1105.mcz

Patrick R.

Regarding the headerFlagForEncoder: method: I only wanted to make the 

code easier to understand. I have no experience with the CompiledCode 

and Encoder classes and did not want to break anything there.


Regarding the two commits: I should have ignored the change... I have now

moved the commit in the Inbox to the Treated Inbox. The change is still

open for discussion though :)​



From: Squeak-dev <[hidden email]> on behalf of Nicolas Cellier <[hidden email]>
Sent: Friday, May 19, 2017 14:32
To: The general-purpose Squeak developers list
Subject: Re: [squeak-dev] The Trunk: Kernel-pre.1105.mcz
 


2017-05-19 14:22 GMT+02:00 <[hidden email]>:
Patrick Rein uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-pre.1105.mcz

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

Name: Kernel-pre.1105
Author: pre
Time: 19 May 2017, 2:22:29.00196 pm
UUID: 7e22498c-7586-584c-a2a9-81331c572590
Ancestors: Kernel-pre.1104

Removes a redundancy in CompiledCode.

=============== Diff against Kernel-nice.1103 ===============

Item was changed:
  ----- Method: CompiledCode class>>headerFlagForEncoder: (in category 'method encoding') -----
  headerFlagForEncoder: anEncoder
-       anEncoder class == PrimaryBytecodeSetEncoderClass ifTrue:
-               [^0].
-       anEncoder class == SecondaryBytecodeSetEncoderClass ifTrue:
-               [^SmallInteger minVal].
        "This allows subclasses for compiler variants such as the ScriptEncoder in EToys
         to continue to function."
+       (anEncoder isKindOf: PrimaryBytecodeSetEncoderClass) ifTrue:
-       (anEncoder class inheritsFrom: PrimaryBytecodeSetEncoderClass) ifTrue:
                [^0].
+       (anEncoder isKindOf: SecondaryBytecodeSetEncoderClass) ifTrue:
-       (anEncoder class inheritsFrom: SecondaryBytecodeSetEncoderClass) ifTrue:
                [^SmallInteger minVal].
        self error: 'The encoder is not one of the two installed bytecode sets'!

Then why not send a message back to anEncoder?
Way more efficient than testing classes sequentially and recursively...
 
Item was added:
+ ----- Method: Number>>** (in category 'mathematical functions') -----
+ ** aNumber
+
+       ^ self raisedTo: aNumber!

Above change can't both be waiting in inbox and be commited to trunk



Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Kernel-pre.1105.mcz

Nicolas Cellier


2017-05-19 15:16 GMT+02:00 Rein, Patrick <[hidden email]>:

Regarding the headerFlagForEncoder: method: I only wanted to make the 

code easier to understand. I have no experience with the CompiledCode 

and Encoder classes and did not want to break anything there.


Nevermind, I overlooked the code.
There is no other way than isKindOf: because PrimaryBytecodeSetEncoderClass is a class variable that can be changed dynamically to point to another BytecodeEncoder class.
If we would want to support doing it by message sending, it would mean compiling and installing/uninstalling messages like isPrimaryEncoderClass dynamically.
Overkill.

Regarding the two commits: I should have ignored the change... I have now

moved the commit in the Inbox to the Treated Inbox. The change is still

open for discussion though :)​


I have this selector in all my images for 30 years or so, if we think of biased as disqualified, I'm disqualified ;)


From: Squeak-dev <[hidden email]> on behalf of Nicolas Cellier <[hidden email]>
Sent: Friday, May 19, 2017 14:32
To: The general-purpose Squeak developers list
Subject: Re: [squeak-dev] The Trunk: Kernel-pre.1105.mcz
 


2017-05-19 14:22 GMT+02:00 <[hidden email]>:
Patrick Rein uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-pre.1105.mcz

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

Name: Kernel-pre.1105
Author: pre
Time: 19 May 2017, 2:22:29.00196 pm
UUID: 7e22498c-7586-584c-a2a9-81331c572590
Ancestors: Kernel-pre.1104

Removes a redundancy in CompiledCode.

=============== Diff against Kernel-nice.1103 ===============

Item was changed:
  ----- Method: CompiledCode class>>headerFlagForEncoder: (in category 'method encoding') -----
  headerFlagForEncoder: anEncoder
-       anEncoder class == PrimaryBytecodeSetEncoderClass ifTrue:
-               [^0].
-       anEncoder class == SecondaryBytecodeSetEncoderClass ifTrue:
-               [^SmallInteger minVal].
        "This allows subclasses for compiler variants such as the ScriptEncoder in EToys
         to continue to function."
+       (anEncoder isKindOf: PrimaryBytecodeSetEncoderClass) ifTrue:
-       (anEncoder class inheritsFrom: PrimaryBytecodeSetEncoderClass) ifTrue:
                [^0].
+       (anEncoder isKindOf: SecondaryBytecodeSetEncoderClass) ifTrue:
-       (anEncoder class inheritsFrom: SecondaryBytecodeSetEncoderClass) ifTrue:
                [^SmallInteger minVal].
        self error: 'The encoder is not one of the two installed bytecode sets'!

Then why not send a message back to anEncoder?
Way more efficient than testing classes sequentially and recursively...
 
Item was added:
+ ----- Method: Number>>** (in category 'mathematical functions') -----
+ ** aNumber
+
+       ^ self raisedTo: aNumber!

Above change can't both be waiting in inbox and be commited to trunk







Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Kernel-pre.1105.mcz

Eliot Miranda-2
Hi Nicolas,


On May 22, 2017, at 5:04 AM, Nicolas Cellier <[hidden email]> wrote:



2017-05-19 15:16 GMT+02:00 Rein, Patrick <[hidden email]>:

Regarding the headerFlagForEncoder: method: I only wanted to make the 

code easier to understand. I have no experience with the CompiledCode 

and Encoder classes and did not want to break anything there.


Nevermind, I overlooked the code.
There is no other way than isKindOf: because PrimaryBytecodeSetEncoderClass is a class variable that can be changed dynamically to point to another BytecodeEncoder class.
If we would want to support doing it by message sending, it would mean compiling and installing/uninstalling messages like isPrimaryEncoderClass dynamically.
Overkill.

Regarding the two commits: I should have ignored the change... I have now

moved the commit in the Inbox to the Treated Inbox. The change is still

open for discussion though :)​


One alternative would be to add a class instance variable to BytecodeEncoder and arrange that 
- whenever the bytecode encoder classes are changed
- whenever a subclass of BytecodeEncoder is added
the variable is updated.

Better would be for the accessor to be lazy.  Then when a different t encoder class is installed all we do is flush the inst var in BytecodeEncoder and all its subclasses.

I do hate isKindOf: :-)

 I have this selector in all my images for 30 years or so, if we think of biased as disqualified, I'm disqualified ;) 


From: Squeak-dev <[hidden email]> on behalf of Nicolas Cellier <[hidden email]>
Sent: Friday, May 19, 2017 14:32
To: The general-purpose Squeak developers list
Subject: Re: [squeak-dev] The Trunk: Kernel-pre.1105.mcz
 


2017-05-19 14:22 GMT+02:00 <[hidden email]>:
Patrick Rein uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-pre.1105.mcz

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

Name: Kernel-pre.1105
Author: pre
Time: 19 May 2017, 2:22:29.00196 pm
UUID: 7e22498c-7586-584c-a2a9-81331c572590
Ancestors: Kernel-pre.1104

Removes a redundancy in CompiledCode.

=============== Diff against Kernel-nice.1103 ===============

Item was changed:
  ----- Method: CompiledCode class>>headerFlagForEncoder: (in category 'method encoding') -----
  headerFlagForEncoder: anEncoder
-       anEncoder class == PrimaryBytecodeSetEncoderClass ifTrue:
-               [^0].
-       anEncoder class == SecondaryBytecodeSetEncoderClass ifTrue:
-               [^SmallInteger minVal].
        "This allows subclasses for compiler variants such as the ScriptEncoder in EToys
         to continue to function."
+       (anEncoder isKindOf: PrimaryBytecodeSetEncoderClass) ifTrue:
-       (anEncoder class inheritsFrom: PrimaryBytecodeSetEncoderClass) ifTrue:
                [^0].
+       (anEncoder isKindOf: SecondaryBytecodeSetEncoderClass) ifTrue:
-       (anEncoder class inheritsFrom: SecondaryBytecodeSetEncoderClass) ifTrue:
                [^SmallInteger minVal].
        self error: 'The encoder is not one of the two installed bytecode sets'!

Then why not send a message back to anEncoder?
Way more efficient than testing classes sequentially and recursively...
 
Item was added:
+ ----- Method: Number>>** (in category 'mathematical functions') -----
+ ** aNumber
+
+       ^ self raisedTo: aNumber!

Above change can't both be waiting in inbox and be commited to trunk